aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-04-07 08:53:43 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-04-07 08:53:43 -0700
commita7eaf017f95932eb2d654bd61f4c4a873ba71f77 (patch)
tree32106153180c4da5bda101549c6ef8e568290e2f
parent8170f7693bc0a9442c0aa280197925db92d48ca6 (diff)
downloadfsf-binutils-gdb-a7eaf017f95932eb2d654bd61f4c4a873ba71f77.zip
fsf-binutils-gdb-a7eaf017f95932eb2d654bd61f4c4a873ba71f77.tar.gz
fsf-binutils-gdb-a7eaf017f95932eb2d654bd61f4c4a873ba71f77.tar.bz2
Use NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIE
Since not all compilers support -no-pie, NOPIE_CFLAGS and NOPIE_LDFLAGS should be used to disable PIE. PR ld/21090 * testsuite/ld-x86-64/x86-64.exp (undefined_weak): Use NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIE for the non-pie version of the test.
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/testsuite/ld-x86-64/x86-64.exp4
2 files changed, 10 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index 044b947..29d8530 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,12 @@
2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
+ PR ld/21090
+ * testsuite/ld-x86-64/x86-64.exp (undefined_weak): Use
+ NOPIE_CFLAGS and NOPIE_LDFLAGS to disable PIE for the non-pie
+ version of the test.
+
+2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
+
PR ld/19579
PR ld/21306
* testsuite/ld-elf/pr19579a.c (main): Updated.
diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp
index 579ffc1..a9394c3 100644
--- a/ld/testsuite/ld-x86-64/x86-64.exp
+++ b/ld/testsuite/ld-x86-64/x86-64.exp
@@ -589,6 +589,8 @@ proc undefined_weak {cflags ldflags} {
# Add $PLT_CFLAGS if PLT is expected.
global PLT_CFLAGS
+# Add $NOPIE_CFLAGS and $NOPIE_LDFLAGS if non-PIE is required.
+global NOPIE_CFLAGS NOPIE_LDFLAGS
# Must be native with the C compiler
if { [isnative] && [which $CC] != 0 } {
@@ -1277,7 +1279,7 @@ if { [isnative] && [which $CC] != 0 } {
]
}
- undefined_weak "-fno-pie" "-no-pie"
+ undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
undefined_weak "-fPIE" ""
undefined_weak "-fPIE" "-pie"
undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak"