diff options
author | Alan Modra <amodra@gmail.com> | 2021-05-03 07:57:39 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-05-03 15:34:17 +0930 |
commit | 5072b52d28f56586a708019a97b8a4456c0c7212 (patch) | |
tree | 72bff5581fedfa50514e1c504f4447f227217ce5 /bfd | |
parent | db543a7de3f3356133ef3f7f7fc9ae444fd55325 (diff) | |
download | gdb-5072b52d28f56586a708019a97b8a4456c0c7212.zip gdb-5072b52d28f56586a708019a97b8a4456c0c7212.tar.gz gdb-5072b52d28f56586a708019a97b8a4456c0c7212.tar.bz2 |
csky: fix annobin test fails
* elf32-csky.c (is_mapping_symbol_name): New function.
(csky_elf_is_target_special_symbol): Likewise.
(csky_elf_maybe_function_sym): Likewise.
(bfd_elf32_bfd_is_target_special_symbol): Define.
(elf_backend_maybe_function_sym): Define.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf32-csky.c | 34 |
2 files changed, 42 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c5a617c..3a23a18 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2021-05-03 Alan Modra <amodra@gmail.com> + + * elf32-csky.c (is_mapping_symbol_name): New function. + (csky_elf_is_target_special_symbol): Likewise. + (csky_elf_maybe_function_sym): Likewise. + (bfd_elf32_bfd_is_target_special_symbol): Define. + (elf_backend_maybe_function_sym): Define. + 2021-04-30 Nick Clifton <nickc@redhat.com> PR 27801 diff --git a/bfd/elf32-csky.c b/bfd/elf32-csky.c index 3ab4639..927fb90 100644 --- a/bfd/elf32-csky.c +++ b/bfd/elf32-csky.c @@ -2432,6 +2432,38 @@ csky_elf_gc_mark_hook (asection *sec, return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } +/* Match symbol names created by tc-csky.c:make_mapping_symbol. */ + +static bool +is_mapping_symbol_name (const char *name) +{ + return (name && name[0] == '$' + && (name[1] == 't' || name[1] == 'd') + && name[2] == 0); +} + +/* Treat mapping symbols as special target symbols. */ + +static bool +csky_elf_is_target_special_symbol (bfd *abfd ATTRIBUTE_UNUSED, asymbol *sym) +{ + return is_mapping_symbol_name (sym->name); +} + +/* Exclude mapping symbols from being treated as function symbols by + objdump and nm. */ + +static bfd_size_type +csky_elf_maybe_function_sym (const asymbol *sym, asection *sec, + bfd_vma *code_off) +{ + if ((sym->flags & BSF_LOCAL) != 0 + && is_mapping_symbol_name (sym->name)) + return 0; + + return _bfd_elf_maybe_function_sym (sym, sec, code_off); +} + /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ @@ -5293,6 +5325,8 @@ elf32_csky_obj_attrs_handle_unknown (bfd *abfd ATTRIBUTE_UNUSED, #define bfd_elf32_bfd_merge_private_bfd_data csky_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags csky_elf_set_private_flags #define elf_backend_copy_indirect_symbol csky_elf_copy_indirect_symbol +#define bfd_elf32_bfd_is_target_special_symbol csky_elf_is_target_special_symbol +#define elf_backend_maybe_function_sym csky_elf_maybe_function_sym /* GC section related API. */ #define elf_backend_can_gc_sections 1 |