aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-02-15 10:55:51 -0800
committerH.J. Lu <hjl.tools@gmail.com>2017-02-15 11:11:40 -0800
commita5def14f1ca70e14d9433cb229c9369fa3051598 (patch)
treefb14176e5377b05dc9ac4bb6119f8095c868a2a4 /bfd
parentf98d33be3af3a8d788aaef37e8fef167b59c81b2 (diff)
downloadgdb-a5def14f1ca70e14d9433cb229c9369fa3051598.zip
gdb-a5def14f1ca70e14d9433cb229c9369fa3051598.tar.gz
gdb-a5def14f1ca70e14d9433cb229c9369fa3051598.tar.bz2
Add a test for R_386_GOT32/R_386_GOT32X IFUNC reloc error
bfd/ PR ld/20244 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC symbol name when reporting R_386_GOT32/R_386_GOT32X relocation error against local IFUNC symbol without a base register for PIC. ld/ PR ld/20244 * testsuite/ld-i386/i386.exp: Run pr20244-4a, pr20244-4b and pr20244-4c. * testsuite/ld-i386/pr20244-4.s: New file. * testsuite/ld-i386/pr20244-4a.d: Likewise. * testsuite/ld-i386/pr20244-4b.d: Likewise. * testsuite/ld-i386/pr20244-4c.d: Likewise.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog8
-rw-r--r--bfd/elf32-i386.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index edd7633..cbea9a9 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,11 @@
+2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/20244
+ * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
+ symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
+ error against local IFUNC symbol without a base register for
+ PIC.
+
2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
* elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 0860ada..3bee4ca 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -4355,7 +4355,7 @@ r_386_got32:
const char *name;
disallow_got32:
- if (h == NULL)
+ if (h == NULL || h->root.root.string == NULL)
name = bfd_elf_sym_name (input_bfd, symtab_hdr, sym,
NULL);
else