aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
Diffstat (limited to 'ld')
-rw-r--r--ld/ChangeLog8
-rw-r--r--ld/testsuite/ld-x86-64/pr19969.d4
-rw-r--r--ld/testsuite/ld-x86-64/pr19969a.S7
-rw-r--r--ld/testsuite/ld-x86-64/pr19969b.S14
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp3
5 files changed, 36 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ac908e5..efa69f9 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,13 @@
2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/19969
+ * testsuite/ld-x86-64/pr19969.d: New file.
+ * testsuite/ld-x86-64/pr19969a.S: Likewise.
+ * testsuite/ld-x86-64/pr19969b.S: Likewise.
+ * testsuite/ld-x86-64/x86-64.exp: Run pr19969 tests.
+
+2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
+
* emulparams/elf32_x86_64.sh (CHECK_RELOCS_AFTER_OPEN_INPUT):
New.
* emulparams/elf_i386.sh (CHECK_RELOCS_AFTER_OPEN_INPUT):
diff --git a/ld/testsuite/ld-x86-64/pr19969.d b/ld/testsuite/ld-x86-64/pr19969.d
new file mode 100644
index 0000000..c56af2f
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr19969.d
@@ -0,0 +1,4 @@
+#source: pr19969b.S
+#as: --64
+#ld: -melf_x86_64 tmpdir/pr19969.so
+#error: .*relocation R_X86_64_32 against symbol `foo' can not be used when making a shared object; recompile with -fPIC
diff --git a/ld/testsuite/ld-x86-64/pr19969a.S b/ld/testsuite/ld-x86-64/pr19969a.S
new file mode 100644
index 0000000..f318401
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr19969a.S
@@ -0,0 +1,7 @@
+ .data
+ .align 4
+ .global foo
+ .type foo, @object
+ .size foo, 4
+foo:
+ .long -1
diff --git a/ld/testsuite/ld-x86-64/pr19969b.S b/ld/testsuite/ld-x86-64/pr19969b.S
new file mode 100644
index 0000000..eabeba2
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pr19969b.S
@@ -0,0 +1,14 @@
+ .text
+ .globl _start
+ .type _start, @function
+_start:
+ movl foo_p(%rip), %eax
+ ret
+ .size _start, .-_start
+ .globl foo_p
+ .data
+ .align 4
+ .type foo_p, @object
+ .size foo_p, 4
+foo_p:
+ .long foo
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 2dba81d..fbd39af 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -156,6 +156,8 @@ set x86_64tests {
"--64" { dummy.s } {{readelf {-rW} pr19827.rd}} "pr19827"}
{"Build pr19827.so" "-melf_x86_64 -shared -Bsymbolic" ""
"--64" { pr19827a.S } {{readelf {-rW} pr19827.rd}} "pr19827.so"}
+ {"Build pr19969.so" "-melf_x86_64 -shared" ""
+ "--64" { pr19969a.S } {} "pr19969.so"}
}
# So as to avoid rewriting every last test case here in a nacl variant,
@@ -262,6 +264,7 @@ run_dump_test "pr19807-2b"
run_dump_test "pr19807-2c"
run_dump_test "pr19807-2d"
run_dump_test "pr19807-2e"
+run_dump_test "pr19969"
if { ![istarget "x86_64-*-linux*"] && ![istarget "x86_64-*-nacl*"]} {
return