aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-04-07 22:23:21 +0930
committerAlan Modra <amodra@gmail.com>2015-04-07 23:22:11 +0930
commit87070c082fd5c23e9a0e7994ff9ea13f6faecb3e (patch)
tree597a6b184c8af91bd452733a0516257856580fb6 /bfd
parent0fad6e4b94e754e26e904bab074bf6c94d825711 (diff)
downloadfsf-binutils-gdb-87070c082fd5c23e9a0e7994ff9ea13f6faecb3e.zip
fsf-binutils-gdb-87070c082fd5c23e9a0e7994ff9ea13f6faecb3e.tar.gz
fsf-binutils-gdb-87070c082fd5c23e9a0e7994ff9ea13f6faecb3e.tar.bz2
Modify get_reloc_section for targets that map .got.plt to .got
Fixes tic6x testsuite failures due to .rela.plt having a zero sh_info. I considered passing link_info to get_reloc_section so we could directly return the .got.plt output section, but we need the fallback to name lookup anyway for objcopy. bfd/ * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being mapped to output .got section. ld/testsuite/ * ld-arm/tls-gdesc-nlazy.g: Adjust for readelf note. * ld-tic6x/shlib-1.rd: Expect corrected .rela.plt sh_info. * ld-tic6x/shlib-1b.rd: Likewise. * ld-tic6x/shlib-1r.rd: Likewise. * ld-tic6x/shlib-1rb.rd: Likewise. * ld-tic6x/shlib-app-1.rd: Likewise. * ld-tic6x/shlib-app-1b.rd: Likewise. * ld-tic6x/shlib-app-1r.rd: Likewise. * ld-tic6x/shlib-app-1rb.rd: Likewise. * ld-tic6x/shlib-noindex.rd: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elf.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4763585..192d9aa 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2015-04-07 Alan Modra <amodra@gmail.com>
+ * elf.c (_bfd_elf_get_reloc_section): Allow for .got.plt being
+ mapped to output .got section.
+
+2015-04-07 Alan Modra <amodra@gmail.com>
+
* elf32-ppc.c (struct ppc_elf_link_hash_entry): Add has_addr16_ha
and has_addr16_lo. Make has_sda_refs a bitfield.
(ppc_elf_check_relocs): Set new flags.
diff --git a/bfd/elf.c b/bfd/elf.c
index bb5f1c6..5fad4f1 100644
--- a/bfd/elf.c
+++ b/bfd/elf.c
@@ -3102,7 +3102,15 @@ _bfd_elf_get_reloc_section (asection *reloc_sec)
abfd = reloc_sec->owner;
if (get_elf_backend_data (abfd)->want_got_plt
&& strcmp (name, ".plt") == 0)
- name = ".got.plt";
+ {
+ /* .got.plt is a linker created input section. It may be mapped
+ to some other output section. Try two likely sections. */
+ name = ".got.plt";
+ reloc_sec = bfd_get_section_by_name (abfd, name);
+ if (reloc_sec != NULL)
+ return reloc_sec;
+ name = ".got";
+ }
reloc_sec = bfd_get_section_by_name (abfd, name);
return reloc_sec;