aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-04-24 14:37:12 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-04-24 14:37:12 -0700
commit9e9821ddd80c0d0b3dda54d34cc8867f256d4583 (patch)
tree0d36e2b7fc6b5eada69e538373a900317ef78279 /ld
parent0dc9a308a1ec9675bf6b33bae9e8b1faa0bad9ed (diff)
downloadgdb-9e9821ddd80c0d0b3dda54d34cc8867f256d4583.zip
gdb-9e9821ddd80c0d0b3dda54d34cc8867f256d4583.tar.gz
gdb-9e9821ddd80c0d0b3dda54d34cc8867f256d4583.tar.bz2
x86-64: Force symbol dynamic if it isn't undefined weak
Force symbol dynamic if it isn't undefined weak. Generate relative relocation for GOT reference against non-dynamic symbol in PIC to avoid unnecessary dynamic symbols. bfd/ * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add no_finish_dynamic_symbol. (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to 0. (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined weak symbol, don't make it dynamic. (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC, set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE relocation for GOT reference. (elf_x86_64_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol isn't 0. ld/ * testsuite/ld-x86-64/no-plt.exp: Also check no-plt-1e.nd. * testsuite/ld-x86-64/no-plt-1e.nd: New file.
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog5
-rw-r--r--ld/testsuite/ld-x86-64/no-plt-1e.nd7
-rw-r--r--ld/testsuite/ld-x86-64/no-plt.exp2
3 files changed, 13 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index d40086e..ed3797e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,10 @@
2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
+ * testsuite/ld-x86-64/no-plt.exp: Also check no-plt-1e.nd.
+ * testsuite/ld-x86-64/no-plt-1e.nd: New file.
+
+2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
+
* testsuite/ld-i386/pr12570a.d: Skip for nacl targets.
* testsuite/ld-i386/pr12570b.d: Likewise.
diff --git a/ld/testsuite/ld-x86-64/no-plt-1e.nd b/ld/testsuite/ld-x86-64/no-plt-1e.nd
new file mode 100644
index 0000000..c96760c
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/no-plt-1e.nd
@@ -0,0 +1,7 @@
+#nm: -g -D
+#target: x86_64-*-*
+
+#failif
+#...
+[0-9]+ +T +func
+#...
diff --git a/ld/testsuite/ld-x86-64/no-plt.exp b/ld/testsuite/ld-x86-64/no-plt.exp
index 5b5c817..9cecd03 100644
--- a/ld/testsuite/ld-x86-64/no-plt.exp
+++ b/ld/testsuite/ld-x86-64/no-plt.exp
@@ -111,7 +111,7 @@ run_cc_link_tests [list \
tmpdir/no-plt-func1.o tmpdir/no-plt-extern1.o" \
"" \
{dummy.s} \
- {{readelf -Wr no-plt-1e.rd} {objdump -dwrj.text no-plt-1e.dd}} \
+ {{readelf -Wr no-plt-1e.rd} {nm -gD no-plt-1e.nd} {objdump -dwrj.text no-plt-1e.dd}} \
"no-plt-1e" \
] \
[list \