diff options
author | caiyinyu <caiyinyu@loongson.cn> | 2022-04-11 11:19:50 +0800 |
---|---|---|
committer | liuzhensong <liuzhensong@loongson.cn> | 2022-04-14 09:13:39 +0800 |
commit | e6f601b74d12c84729ebe627725477b5a47e44e5 (patch) | |
tree | 2e625405f8924cb7b97c9bbfa683400b0253668f /bfd | |
parent | a9703116de75a8266ee0b0881c49e85d747a83d5 (diff) | |
download | binutils-e6f601b74d12c84729ebe627725477b5a47e44e5.zip binutils-e6f601b74d12c84729ebe627725477b5a47e44e5.tar.gz binutils-e6f601b74d12c84729ebe627725477b5a47e44e5.tar.bz2 |
ld:LoongArch: Fix glibc fail: tst-audit25a/b.
bfd/
* elfnn-loongarch.c: Add new func elf_loongarch64_hash_symbol.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/elfnn-loongarch.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c index 8aaf157..3c7268c 100644 --- a/bfd/elfnn-loongarch.c +++ b/bfd/elfnn-loongarch.c @@ -3390,6 +3390,21 @@ loongarch_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info, return _bfd_elf_gc_mark_hook (sec, info, rel, h, sym); } +/* Return TRUE if symbol H should be hashed in the `.gnu.hash' section. For + executable PLT slots where the executable never takes the address of those + functions, the function symbols are not added to the hash table. */ + +static bool +elf_loongarch64_hash_symbol (struct elf_link_hash_entry *h) +{ + if (h->plt.offset != (bfd_vma) -1 + && !h->def_regular + && !h->pointer_equality_needed) + return false; + + return _bfd_elf_hash_symbol (h); +} + #define TARGET_LITTLE_SYM loongarch_elfNN_vec #define TARGET_LITTLE_NAME "elfNN-loongarch" #define ELF_ARCH bfd_arch_loongarch @@ -3421,5 +3436,6 @@ loongarch_elf_gc_mark_hook (asection *sec, struct bfd_link_info *info, #define elf_backend_plt_sym_val loongarch_elf_plt_sym_val #define elf_backend_grok_prstatus loongarch_elf_grok_prstatus #define elf_backend_grok_psinfo loongarch_elf_grok_psinfo +#define elf_backend_hash_symbol elf_loongarch64_hash_symbol #include "elfNN-target.h" |