diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-08-26 11:28:26 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-08-26 11:57:35 -0700 |
commit | 05fd99cc80b1955e8c846dacfa57fe52816d4869 (patch) | |
tree | ecc89255958362cd0747dbbe60f5959d7c16b986 /ld/testsuite/ld-elfcomm | |
parent | Fix sanitization problems in the BFD library when running the linker testsuit... (diff) | |
download | binutils-gdb-05fd99cc80b1955e8c846dacfa57fe52816d4869.tar.gz binutils-gdb-05fd99cc80b1955e8c846dacfa57fe52816d4869.tar.bz2 binutils-gdb-05fd99cc80b1955e8c846dacfa57fe52816d4869.zip |
ld: Add $NOSANTIZE_CFLAGS to more linker tests
-fsanitize= can be used to build binutils with
$ CC="gcc -fsanitize=address,undefined" CXX="g++ -fsanitize=address,undefined" .../configure --disable-werror
Since not all linker tests are compatible with -fsanitize=, pass
$NOSANTIZE_CFLAGS to disable -fsanitize= for such tests.
* testsuite/ld-elf/indirect.exp: Append $NOSANTIZE_CFLAGS to CC.
* testsuite/ld-elf/shared.exp: Likewise.
* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
* testsuite/ld-elfvers/vers.exp: Likewise.
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
* testsuite/ld-elfweak/elfweak.exp: Likewise.
* testsuite/ld-plugin/lto.exp: Likewise.
* testsuite/ld-plugin/plugin.exp: Likewise.
* testsuite/ld-scripts/crossref.exp: Likewise.
Diffstat (limited to 'ld/testsuite/ld-elfcomm')
-rw-r--r-- | ld/testsuite/ld-elfcomm/elfcomm.exp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ld/testsuite/ld-elfcomm/elfcomm.exp b/ld/testsuite/ld-elfcomm/elfcomm.exp index d23929ea0b1..88dbe46f3bf 100644 --- a/ld/testsuite/ld-elfcomm/elfcomm.exp +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp @@ -169,9 +169,9 @@ if [istarget nios2*-*-*] { # Explicitly use "-fcommon" so that even if $CFLAGS includes # "-fno-common", these tests are compiled as expected. -if { ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1a.c tmpdir/common1a.o] - || ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o] - || ![ld_compile "$CC $CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { +if { ![ld_compile "$CC $CFLAGS -fcommon $NOSANTIZE_CFLAGS" $srcdir/$subdir/common1a.c tmpdir/common1a.o] + || ![ld_compile "$CC $CFLAGS -fcommon $NOSANTIZE_CFLAGS" $srcdir/$subdir/common1b.c tmpdir/common1b.o] + || ![ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS -Wa,--elf-stt-common=yes -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1c.o] } { unresolved $test1 unresolved $test1 return |