aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-03-30 04:40:33 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-03-30 04:40:49 -0700
commitbd53a53af486c6e5ab88b7f64342244392be1f1f (patch)
treebb7d41577e217ff63481159f9bd65dca1a510ded /ld
parent457983e3a30212740a599ffa7cbf5142ffe67367 (diff)
downloadfsf-binutils-gdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.zip
fsf-binutils-gdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.tar.gz
fsf-binutils-gdb-bd53a53af486c6e5ab88b7f64342244392be1f1f.tar.bz2
Properly set sh_info for .rela.plt/rel.plt section
Since .rela.plt/rel.plt section may contain relocations against .got.plt section, we set sh_info for .rela.plt/rel.plt section to .got.plt section index if target has .got.plt section. bfd/ PR ld/18169 * elf-bfd.h (elf_backend_data): Add get_reloc_section. (_bfd_elf_get_reloc_section): New. * elf.c (_bfd_elf_get_reloc_section): Likewise. (assign_section_numbers): Call get_reloc_section to look up the section the relocs apply. * elfxx-target.h (elf_backend_get_reloc_section): Likewise. (elfNN_bed): Initialize get_reloc_section with elf_backend_get_reloc_section. ld/testsuite/ PR ld/18169 * ld-elf/linkinfo1a.d: Updated. * ld-elf/linkinfo1b.d: Likewise.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog6
-rw-r--r--ld/testsuite/ld-elf/linkinfo1a.d4
-rw-r--r--ld/testsuite/ld-elf/linkinfo1b.d4
3 files changed, 12 insertions, 2 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index 8911a9a..ff9ba66 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-03-30 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/18169
+ * ld-elf/linkinfo1a.d: Updated.
+ * ld-elf/linkinfo1b.d: Likewise.
+
2015-03-27 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/pr18160.d: Don't run for x86_64-*-nacl* target.
diff --git a/ld/testsuite/ld-elf/linkinfo1a.d b/ld/testsuite/ld-elf/linkinfo1a.d
index 8c6fb71..b5ccf6f 100644
--- a/ld/testsuite/ld-elf/linkinfo1a.d
+++ b/ld/testsuite/ld-elf/linkinfo1a.d
@@ -4,5 +4,7 @@
#target: x86_64-* i?86-*
#...
- \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t0-9a-f]+
+ \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t]+[0-9a-f]+[ \t]+9[ \t]+[0-9a-f]+
+#...
+ \[[ 9\] \.got.plt[ \t]+PROGBITS?[ \t][ \t0-9a-f]+WA[ \t]+[0-9a-f]+[ \t]+0[ \t]+[0-9a-f]+
#pass
diff --git a/ld/testsuite/ld-elf/linkinfo1b.d b/ld/testsuite/ld-elf/linkinfo1b.d
index cc3aaed..cb17683 100644
--- a/ld/testsuite/ld-elf/linkinfo1b.d
+++ b/ld/testsuite/ld-elf/linkinfo1b.d
@@ -5,5 +5,7 @@
#target: x86_64-* i?86-*
#...
- \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t0-9a-f]+
+ \[[ 0-9]+\] \.rel[a]?\.plt[ \t]+REL[A]?[ \t][ \t0-9a-f]+AI[ \t]+[0-9a-f]+[ \t]+9[ \t]+[0-9a-f]+
+#...
+ \[[ 9\] \.got.plt[ \t]+PROGBITS?[ \t][ \t0-9a-f]+WA[ \t]+[0-9a-f]+[ \t]+0[ \t]+[0-9a-f]+
#pass