]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86: Pass $NOPIE_LDFLAGS to undefined weak tests
authorJens Remus <jremus@linux.ibm.com>
Fri, 28 Mar 2025 14:27:11 +0000 (15:27 +0100)
committerJens Remus <jremus@linux.ibm.com>
Fri, 28 Mar 2025 14:27:11 +0000 (15:27 +0100)
Some distributions configure GCC with --enable-default-pie, so that it
defaults to compile with -fPIE and link with -pie, which is unexpected
by some of the tests.  Therefore link the PDE test programs with
$NOPIE_LDFLAGS to disable PIE.

This complements commit a7eaf017f959 ("Use NOPIE_CFLAGS and
NOPIE_LDFLAGS to disable PIE").

ld/testsuite/
PR ld/21090
* ld-x86-64/x86-64.exp (undefined_weak): Use NOPIE_LDFLAGS to
disable PIE for the non-PIE versions of the test.

Bug: https://sourceware.org/PR21090
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
ld/testsuite/ld-x86-64/x86-64.exp

index 01d6459b5d79c03de4587e009284cb1433361fad..52c4d5e0e6bbdfb4735759e712a54fbb18cab556 100644 (file)
@@ -2168,9 +2168,9 @@ if { [isnative] && [check_compiler_available] } {
     }
 
     undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS"
-    undefined_weak "-fPIE" ""
+    undefined_weak "-fPIE" "$NOPIE_LDFLAGS"
     undefined_weak "-fPIE" "-pie"
-    undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak"
+    undefined_weak "-fPIE" "$NOPIE_LDFLAGS -Wl,-z,nodynamic-undefined-weak"
     undefined_weak "-fPIE" "-pie -Wl,-z,nodynamic-undefined-weak"
 }