diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-12-29 10:41:51 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2021-01-06 16:38:53 -0800 |
commit | d4e57b87a3d5879917c30e33b14760fd76ff7b38 (patch) | |
tree | 22a03a00ae91860c71bc1af120a18844d406bc54 /bfd | |
parent | 6987d5a1bbf61f56ef188b794a494fb495c9660a (diff) | |
download | gdb-d4e57b87a3d5879917c30e33b14760fd76ff7b38.zip gdb-d4e57b87a3d5879917c30e33b14760fd76ff7b38.tar.gz gdb-d4e57b87a3d5879917c30e33b14760fd76ff7b38.tar.bz2 |
bfin: Check bfd_link_hash_indirect
Add bfd_link_hash_indirect check to check_relocs. This fixed:
FAIL: ld-elf/pr26979a
FAIL: ld-elf/pr26979b
FAIL: Symbol export class test (final shared object)
* elf32-bfin.c (bfin_check_relocs): Check bfd_link_hash_indirect.
(bfinfdpic_check_relocs): Likewise.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/elf32-bfin.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 06d6e39..3a219c7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2021-01-06 H.J. Lu <hongjiu.lu@intel.com> + + * elf32-bfin.c (bfin_check_relocs): Check bfd_link_hash_indirect. + (bfinfdpic_check_relocs): Likewise. + 2021-01-06 Alan Modra <amodra@gmail.com> * elf32-score.c (s3_bfd_score_info_to_howto): Report an error diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c index 0d8050f..7c926b8 100644 --- a/bfd/elf32-bfin.c +++ b/bfd/elf32-bfin.c @@ -1197,6 +1197,9 @@ bfin_check_relocs (bfd * abfd, else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *)h->root.u.i.link; } switch (ELF32_R_TYPE (rel->r_info)) @@ -4523,7 +4526,12 @@ bfinfdpic_check_relocs (bfd *abfd, struct bfd_link_info *info, if (r_symndx < symtab_hdr->sh_info) h = NULL; else - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } switch (ELF32_R_TYPE (rel->r_info)) { |