From: "H.J. Lu" <hjl.tools@gmail.com>
To: binutils@sourceware.org
Subject: [PATCH] Add ld-x86-64/pie2 test
Date: Wed, 20 Apr 2016 18:13:00 -0000 [thread overview]
Message-ID: <1461175973-382-1-git-send-email-hjl.tools@gmail.com> (raw)
* testsuite/ld-x86-64/pie2.d: New file.
* testsuite/ld-x86-64/pie2.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run pie2.
---
ld/ChangeLog | 6 ++++++
ld/testsuite/ld-x86-64/pie2.d | 3 +++
ld/testsuite/ld-x86-64/pie2.s | 8 ++++++++
ld/testsuite/ld-x86-64/x86-64.exp | 1 +
4 files changed, 18 insertions(+)
create mode 100644 ld/testsuite/ld-x86-64/pie2.d
create mode 100644 ld/testsuite/ld-x86-64/pie2.s
diff --git a/ld/ChangeLog b/ld/ChangeLog
index efa69f9..0ce4e2d 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,11 @@
2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
+ * testsuite/ld-x86-64/pie2.d: New file.
+ * testsuite/ld-x86-64/pie2.s: Likewise.
+ * testsuite/ld-x86-64/x86-64.exp: Run pie2.
+
+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.
diff --git a/ld/testsuite/ld-x86-64/pie2.d b/ld/testsuite/ld-x86-64/pie2.d
new file mode 100644
index 0000000..ef9f58a
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pie2.d
@@ -0,0 +1,3 @@
+#as: --64
+#ld: -pie -melf_x86_64
+#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/pie2.s b/ld/testsuite/ld-x86-64/pie2.s
new file mode 100644
index 0000000..7c489a1
--- /dev/null
+++ b/ld/testsuite/ld-x86-64/pie2.s
@@ -0,0 +1,8 @@
+ .text
+ .global _start
+_start:
+ .long foo
+ .data
+ .globl foo
+foo:
+ .byte 0
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index fbd39af..b923fba 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -249,6 +249,7 @@ run_dump_test "pr14215"
run_dump_test "pr14207"
run_dump_test "gotplt1"
run_dump_test "pie1"
+run_dump_test "pie2"
run_dump_test "largecomm-1a"
run_dump_test "largecomm-1b"
run_dump_test "largecomm-1c"
--
2.5.5
reply other threads:[~2016-04-20 18:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461175973-382-1-git-send-email-hjl.tools@gmail.com \
--to=hjl.tools@gmail.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).