aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-i386
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-05-16 07:00:21 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-05-16 07:00:55 -0700
commit25070364b0ce33eed46aa5d78ebebbec6accec7e (patch)
tree1430644f09eb8ae60263110353ea34246592e614 /ld/testsuite/ld-i386
parent4d18dfad9edf822df205edc2c1fe3fe9f1e467b8 (diff)
downloadgdb-25070364b0ce33eed46aa5d78ebebbec6accec7e.zip
gdb-25070364b0ce33eed46aa5d78ebebbec6accec7e.tar.gz
gdb-25070364b0ce33eed46aa5d78ebebbec6accec7e.tar.bz2
Don't generate PLT relocations for now binding
There is no need for PLT relocations with -z now. We can use GOT relocations, which take less space, instead and replace 16-byte .plt entres with 8-byte .plt.got entries. bfd/ * elf32-i386.c (elf_i386_check_relocs): Create .plt.got section for now binding. (elf_i386_allocate_dynrelocs): Use .plt.got section for now binding. * elf64-x86-64.c (elf_x86_64_check_relocs): Create .plt.got section for now binding. (elf_x86_64_allocate_dynrelocs): Use .plt.got section for now binding. ld/testsuite/ * ld-i386/i386.exp: Run PR ld/17689 tests with -z now. * ld-x86-64/x86-64.exp: Likewise * ld-i386/pr17689now.rd: New file. * ld-x86-64/pr17689now.rd: Likewise
Diffstat (limited to 'ld/testsuite/ld-i386')
-rw-r--r--ld/testsuite/ld-i386/i386.exp24
-rw-r--r--ld/testsuite/ld-i386/pr17689now.rd4
2 files changed, 28 insertions, 0 deletions
diff --git a/ld/testsuite/ld-i386/i386.exp b/ld/testsuite/ld-i386/i386.exp
index bbc6005..a26cffd 100644
--- a/ld/testsuite/ld-i386/i386.exp
+++ b/ld/testsuite/ld-i386/i386.exp
@@ -406,6 +406,14 @@ if { [isnative]
"pr17689.so" \
] \
[list \
+ "Build pr17689.so with -z now" \
+ "-shared -Wl,-z,now" \
+ "-fPIC" \
+ { pr17689a.c } \
+ {{readelf {-Wr} pr17689now.rd}} \
+ "pr17689now.so" \
+ ] \
+ [list \
"Build pr17689ver.so" \
"-shared -Wl,--version-script,pr17689a.t" \
"-fPIC" \
@@ -430,6 +438,14 @@ if { [isnative]
"pr17689" \
] \
[list \
+ "Build pr17689 with PIE, -z now and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -Wl,-z,now" \
+ "" \
+ { dummy.c } \
+ {{readelf {-Wr} pr17689now.rd}} \
+ "pr17689now" \
+ ] \
+ [list \
"Build pr17689ver with PIE and GOTOFF" \
"tmpdir/pr17689b.o tmpdir/pr17689ver.so -pie" \
"" \
@@ -484,6 +500,14 @@ if { [isnative]
"pr17689.out" \
] \
[list \
+ "Run pr17689 with PIE, -z now and GOTOFF" \
+ "tmpdir/pr17689b.o tmpdir/pr17689.so -pie -z now" \
+ "" \
+ { dummy.c } \
+ "pr17689now" \
+ "pr17689.out" \
+ ] \
+ [list \
"Run pr17689ver with PIE and GOTOFF" \
"tmpdir/pr17689b.o tmpdir/pr17689ver.so -pie" \
"" \
diff --git a/ld/testsuite/ld-i386/pr17689now.rd b/ld/testsuite/ld-i386/pr17689now.rd
new file mode 100644
index 0000000..9741df8
--- /dev/null
+++ b/ld/testsuite/ld-i386/pr17689now.rd
@@ -0,0 +1,4 @@
+#failif
+#...
+[0-9a-f ]+R_386_JUMP_SLOT +0+.*
+#...