diff options
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r-- | bfd/elf32-arm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c index bcace92..fc7a41c 100644 --- a/bfd/elf32-arm.c +++ b/bfd/elf32-arm.c @@ -15903,6 +15903,8 @@ elf32_arm_gc_mark_extra_sections (struct bfd_link_info *info, struct elf_link_hash_entry **sym_hashes; struct elf32_arm_link_hash_entry *cmse_hash; bfd_boolean again, is_v8m, first_bfd_browse = TRUE; + bfd_boolean debug_sec_need_to_be_marked = FALSE; + asection *isec; _bfd_elf_gc_mark_extra_sections (info, gc_mark_hook); @@ -15964,8 +15966,25 @@ elf32_arm_gc_mark_extra_sections (struct bfd_link_info *info, if (!cmse_sec->gc_mark && !_bfd_elf_gc_mark (info, cmse_sec, gc_mark_hook)) return FALSE; + /* The debug sections related to these secure entry + functions are marked on enabling below flag. */ + debug_sec_need_to_be_marked = TRUE; } } + + if (debug_sec_need_to_be_marked) + { + /* Looping over all the sections of the object file containing + Armv8-M secure entry functions and marking all the debug + sections. */ + for (isec = sub->sections; isec != NULL; isec = isec->next) + { + /* If not a debug sections, skip it. */ + if (!isec->gc_mark && (isec->flags & SEC_DEBUGGING)) + isec->gc_mark = 1 ; + } + debug_sec_need_to_be_marked = FALSE; + } } } first_bfd_browse = FALSE; |