[PATCH v2 4/6] ld: Pass $NOPIE_CFLAGS and $NOPIE_LDFLAGS to even more ELF shared tests
Jan Beulich
jbeulich@suse.com
Mon Mar 24 16:14:00 GMT 2025
On 21.03.2025 17:58, Jens Remus wrote:
> Some distributions configure GCC with --enable-default-pie, so that it
> defaults to compile with -fPIE and link with -pie, which is unexpected
> by the test. Therefore compile the non-PIC sources with $NOPIE_CFLAGS
> and link the test programs with $NOPIE_LDFLAGS.
>
> Commit 9d1c54ed7f3a ("Pass $NOPIE_CFLAGS and $NOPIE_LDFLAGS to more ELF
> tests") added $NOPIE_CFLAGS when compiling sh1np.o. It missed to add it
> to sh2np.o and mainnp.o.
>
> ld/testsuite/
> PR ld/21090
> * ld-shared/shared.exp (shared_test): Add support for optional
> ldflags argument and use it when linking the test program.
> (sh2np.o, mainnp.o): Compile with $NOPIE_CFLAGS.
> (shnp, shp, shmpnp, shmpp): Link with $NOPIE_LDFLAGS.
>
> Fixes: 9d1c54ed7f3a ("Pass $NOPIE_CFLAGS and $NOPIE_LDFLAGS to more ELF tests")
> Bug: https://sourceware.org/PR21090
> Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Okay.
Jan
More information about the Binutils
mailing list