aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-15 10:35:38 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-16 11:28:29 -0700
commitbf52d7c72035679e6b3ab601133c56a4388f4dc9 (patch)
treeae10258fcb4672d6938c782bdf1808d1b7a7d7b5 /ld
parentf92339b8f316de65add11aeb9cd8ea72630aa556 (diff)
downloadgdb-bf52d7c72035679e6b3ab601133c56a4388f4dc9.zip
gdb-bf52d7c72035679e6b3ab601133c56a4388f4dc9.tar.gz
gdb-bf52d7c72035679e6b3ab601133c56a4388f4dc9.tar.bz2
Don't check undefined symbol for IFUNC reloc
Since x86 elf_*_check_relocs is called after all symbols have been resolved, there is no need to check undefined symbols for relocations against IFUNC symbols. bfd/ * elf32-i386.c (elf_i386_check_relocs): Don't check undefined symbols for relocations against IFUNC symbols. * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise. ld/ * testsuite/ld-i386/i386.exp: Run pr19636-2e-nacl. * testsuite/ld-i386/pr19636-2e.d: Skip for NaCl targets. Remove .rel.plt section. * testsuite/ld-i386/pr19636-2e-nacl.d: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-i386/i386.exp1
-rw-r--r--ld/testsuite/ld-i386/pr19636-2e-nacl.d21
-rw-r--r--ld/testsuite/ld-i386/pr19636-2e.d5
3 files changed, 23 insertions, 4 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index 8468920..98f0b1c 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -372,6 +372,7 @@ run_dump_test "pr19636-2c-nacl"
run_dump_test "pr19636-2d"
run_dump_test "pr19636-2d-nacl"
run_dump_test "pr19636-2e"
+run_dump_test "pr19636-2e-nacl"
run_dump_test "pr19636-3a"
run_dump_test "pr19636-3b"
run_dump_test "pr19636-3c"
diff --git a/ld/testsuite/ld-i386/pr19636-2e-nacl.d b/ld/testsuite/ld-i386/pr19636-2e-nacl.d
new file mode 100644
index 0000000..f791128
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr19636-2e-nacl.d
@@ -0,0 +1,21 @@
+#source: pr19636-2.s
+#as: --32 -mrelax-relocations=no
+#ld: -shared -Bsymbolic -m elf_i386
+#readelf : -r --wide --dyn-syms
+#target: i?86-*-nacl* x86_64-*-nacl*
+
+Relocation section '\.rel\.dyn' at offset [0x0-9a-f]+ contains 3 entries:
+ +Offset +Info +Type +Sym. Value +Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func
+[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
+[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
+
+Relocation section '\.rel\.plt' at offset [0x0-9a-f]+ contains 1 entries:
+ +Offset +Info +Type +Sym. Value +Symbol's Name
+[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func
+
+Symbol table '\.dynsym' contains [0-9]+ entries:
+ +Num: +Value +Size Type +Bind +Vis +Ndx Name
+#...
+ +[0-9]+: +[a-f0-9]+ +0 +NOTYPE +WEAK +DEFAULT +UND +func
+#pass
diff --git a/ld/testsuite/ld-i386/pr19636-2e.d b/ld/testsuite/ld-i386/pr19636-2e.d
index c985242..148e306 100644
--- a/ld/testsuite/ld-i386/pr19636-2e.d
+++ b/ld/testsuite/ld-i386/pr19636-2e.d
@@ -2,6 +2,7 @@
#as: --32 -mrelax-relocations=no
#ld: -shared -Bsymbolic -m elf_i386
#readelf : -r --wide --dyn-syms
+#notarget: i?86-*-nacl* x86_64-*-nacl*
Relocation section '\.rel\.dyn' at offset [0x0-9a-f]+ contains 3 entries:
+Offset +Info +Type +Sym. Value +Symbol's Name
@@ -9,10 +10,6 @@ Relocation section '\.rel\.dyn' at offset [0x0-9a-f]+ contains 3 entries:
[0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func
[0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func
-Relocation section '\.rel\.plt' at offset [0x0-9a-f]+ contains 1 entries:
- +Offset +Info +Type +Sym. Value +Symbol's Name
-[0-9a-f]+ +[0-9a-f]+ +R_386_JUMP_SLOT +0+ +func
-
Symbol table '\.dynsym' contains [0-9]+ entries:
+Num: +Value +Size Type +Bind +Vis +Ndx Name
#...