Add ld-x86-64/pic1 test
authorH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Apr 2016 18:13:38 +0000 (11:13 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Wed, 20 Apr 2016 18:13:56 +0000 (11:13 -0700)
* testsuite/ld-x86-64/pic1.d: New file.
* testsuite/ld-x86-64/pic1.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pic1.

ld/ChangeLog
ld/testsuite/ld-x86-64/pic1.d [new file with mode: 0644]
ld/testsuite/ld-x86-64/pic1.s [new file with mode: 0644]
ld/testsuite/ld-x86-64/x86-64.exp

index 0ce4e2dcc4464e9ddf6dec9930fa3a357c12d5d7..74be8d4c45f195a1305139bfd63702757dabd708 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/ld-x86-64/pic1.d: New file.
+       * testsuite/ld-x86-64/pic1.s: Likewise.
+       * testsuite/ld-x86-64/x86-64.exp: Run pic1.
+
 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/ld-x86-64/pie2.d: New file.
diff --git a/ld/testsuite/ld-x86-64/pic1.d b/ld/testsuite/ld-x86-64/pic1.d
new file mode 100644 (file)
index 0000000..9e4b957
--- /dev/null
@@ -0,0 +1,3 @@
+#as: --64
+#ld: -shared -melf_x86_64
+#error: .*relocation R_X86_64_32 against undefined symbol `foo' can not be used when making a shared object; recompile with -fPIC
diff --git a/ld/testsuite/ld-x86-64/pic1.s b/ld/testsuite/ld-x86-64/pic1.s
new file mode 100644 (file)
index 0000000..0adb503
--- /dev/null
@@ -0,0 +1,2 @@
+       .data
+       .long foo
index b923fba4e47bd93956d29dd7ad4e6a087d0f8c82..b48f3c7fc4d94eb9afa2845c7e8761389ef25037 100644 (file)
@@ -250,6 +250,7 @@ run_dump_test "pr14207"
 run_dump_test "gotplt1"
 run_dump_test "pie1"
 run_dump_test "pie2"
+run_dump_test "pic1"
 run_dump_test "largecomm-1a"
 run_dump_test "largecomm-1b"
 run_dump_test "largecomm-1c"