ld: Add $NOSANTIZE_CFLAGS to more linker tests
* testsuite/ld-elf/dwarf.exp: Append $NOSANTIZE_CFLAGS to CFLAGS. * testsuite/ld-elf/shared.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise.
This commit is contained in:
parent
d0ed6fddfa
commit
42afa120eb
@ -1,3 +1,11 @@
|
|||||||
|
2020-08-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* testsuite/ld-elf/dwarf.exp: Append $NOSANTIZE_CFLAGS to CFLAGS.
|
||||||
|
* testsuite/ld-elf/shared.exp: Likewise.
|
||||||
|
* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
|
||||||
|
* testsuite/ld-shared/shared.exp: Likewise.
|
||||||
|
* testsuite/ld-size/size.exp: Likewise.
|
||||||
|
|
||||||
2020-08-28 Jozef Lawrynowicz <jozef.l@mittosystems.com>
|
2020-08-28 Jozef Lawrynowicz <jozef.l@mittosystems.com>
|
||||||
|
|
||||||
* emultempl/msp430.em (input_section_exists): New.
|
* emultempl/msp430.em (input_section_exists): New.
|
||||||
|
@ -68,8 +68,12 @@ set run_tests {
|
|||||||
"-g -feliminate-dwarf2-dups"}
|
"-g -feliminate-dwarf2-dups"}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Disable all sanitizers.
|
||||||
|
set old_CFLAGS "$CFLAGS"
|
||||||
|
append CFLAGS " $NOSANTIZE_CFLAGS"
|
||||||
run_cc_link_tests $build_tests
|
run_cc_link_tests $build_tests
|
||||||
run_ld_link_exec_tests $run_tests
|
run_ld_link_exec_tests $run_tests
|
||||||
|
set CFLAGS "$old_CFLAGS"
|
||||||
|
|
||||||
proc strip_test {} {
|
proc strip_test {} {
|
||||||
global ld
|
global ld
|
||||||
|
@ -1102,7 +1102,11 @@ set dlopen_run_tests [list \
|
|||||||
if [check_libdl_available] {
|
if [check_libdl_available] {
|
||||||
# XFAIL on NetBSD ELF systems as they do not currently support the .*_array
|
# XFAIL on NetBSD ELF systems as they do not currently support the .*_array
|
||||||
# sections.
|
# sections.
|
||||||
|
# Disable all sanitizers.
|
||||||
|
set old_CFLAGS "$CFLAGS"
|
||||||
|
append CFLAGS " $NOSANTIZE_CFLAGS"
|
||||||
run_ld_link_exec_tests $dlopen_run_tests "*-*-netbsdelf*"
|
run_ld_link_exec_tests $dlopen_run_tests "*-*-netbsdelf*"
|
||||||
|
set CFLAGS "$old_CFLAGS"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check --no-add-needed and --no-copy-dt-needed-entries
|
# Check --no-add-needed and --no-copy-dt-needed-entries
|
||||||
|
@ -197,6 +197,7 @@ proc visibility_run {visibility} {
|
|||||||
global PLT_CFLAGS
|
global PLT_CFLAGS
|
||||||
global NOPIE_CFLAGS
|
global NOPIE_CFLAGS
|
||||||
global COMPRESS_LDFLAG
|
global COMPRESS_LDFLAG
|
||||||
|
global NOSANTIZE_CFLAGS
|
||||||
|
|
||||||
if [ string match $visibility "hidden" ] {
|
if [ string match $visibility "hidden" ] {
|
||||||
set VSBCFLAG "-DHIDDEN_TEST"
|
set VSBCFLAG "-DHIDDEN_TEST"
|
||||||
@ -235,7 +236,7 @@ proc visibility_run {visibility} {
|
|||||||
} else {
|
} else {
|
||||||
# Compile the main program. Make sure that PLT is used since PLT
|
# Compile the main program. Make sure that PLT is used since PLT
|
||||||
# is expected.
|
# is expected.
|
||||||
if ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
|
if ![ld_compile "$CC -g $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS" $srcdir/$subdir/main.c $tmpdir/mainnp.o] {
|
||||||
unresolved "visibility ($visibility) (non PIC)"
|
unresolved "visibility ($visibility) (non PIC)"
|
||||||
unresolved "visibility ($visibility)"
|
unresolved "visibility ($visibility)"
|
||||||
} else {
|
} else {
|
||||||
@ -245,8 +246,8 @@ proc visibility_run {visibility} {
|
|||||||
# will need to do more relocation work. However, note that not
|
# will need to do more relocation work. However, note that not
|
||||||
# using -fpic will cause some of the tests to return different
|
# using -fpic will cause some of the tests to return different
|
||||||
# results. Make sure that PLT is used since PLT is expected.
|
# results. Make sure that PLT is used since PLT is expected.
|
||||||
if { ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
|
if { ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS" $srcdir/$subdir/sh1.c $tmpdir/sh1np.o]
|
||||||
|| ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
|
|| ![ld_compile "$CC -g $NOPIE_CFLAGS $PLT_CFLAGS $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS" $srcdir/$subdir/sh2.c $tmpdir/sh2np.o] } {
|
||||||
unresolved "visibility ($visibility) (non PIC)"
|
unresolved "visibility ($visibility) (non PIC)"
|
||||||
} else {
|
} else {
|
||||||
# SunOS non PIC shared libraries don't permit some cases of
|
# SunOS non PIC shared libraries don't permit some cases of
|
||||||
@ -334,8 +335,8 @@ proc visibility_run {visibility} {
|
|||||||
|
|
||||||
# Now compile the code using -fpic.
|
# Now compile the code using -fpic.
|
||||||
|
|
||||||
if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
|
if { ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh1.c $tmpdir/sh1p.o]
|
||||||
|| ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
|
|| ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS -DSHARED $picflag" $srcdir/$subdir/sh2.c $tmpdir/sh2p.o] } {
|
||||||
unresolved "visibility ($visibility)"
|
unresolved "visibility ($visibility)"
|
||||||
} else {
|
} else {
|
||||||
if { [ string match $visibility "protected" ]
|
if { [ string match $visibility "protected" ]
|
||||||
@ -352,7 +353,7 @@ proc visibility_run {visibility} {
|
|||||||
# Don't bother.
|
# Don't bother.
|
||||||
} else {
|
} else {
|
||||||
# Now do the same tests again, but this time compile main.c PIC.
|
# Now do the same tests again, but this time compile main.c PIC.
|
||||||
if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG -DSHARED $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
|
if ![ld_compile "$CC -g $CFLAGS $SHCFLAG $VSBCFLAG $NOSANTIZE_CFLAGS -DSHARED $picflag" $srcdir/$subdir/main.c $tmpdir/mainp.o] {
|
||||||
unresolved "visibility ($visibility) (PIC main, non PIC so)"
|
unresolved "visibility ($visibility) (PIC main, non PIC so)"
|
||||||
unresolved "visibility ($visibility) (PIC main)"
|
unresolved "visibility ($visibility) (PIC main)"
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,6 +65,10 @@ set tmpdir tmpdir
|
|||||||
set SHCFLAG ""
|
set SHCFLAG ""
|
||||||
set shared_needs_pic "no"
|
set shared_needs_pic "no"
|
||||||
|
|
||||||
|
# Disable all sanitizers.
|
||||||
|
set old_CFLAGS "$CFLAGS"
|
||||||
|
append CFLAGS " $NOSANTIZE_CFLAGS"
|
||||||
|
|
||||||
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
||||||
|
|
||||||
# AIX shared libraries do not seem to support useful features,
|
# AIX shared libraries do not seem to support useful features,
|
||||||
@ -343,6 +347,8 @@ if ![ld_compile "$CC $CFLAGS $SHCFLAG $picflag" $srcdir/$subdir/main.c $tmpdir/m
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set CFLAGS "$old_CFLAGS"
|
||||||
|
|
||||||
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
if { [istarget rs6000*-*-aix*] || [istarget powerpc*-*-aix*] } {
|
||||||
# Remove the temporary directory.
|
# Remove the temporary directory.
|
||||||
catch "exec rm -rf $tmpdir" exec_status
|
catch "exec rm -rf $tmpdir" exec_status
|
||||||
|
@ -134,8 +134,8 @@ run_cc_link_tests [list \
|
|||||||
] \
|
] \
|
||||||
[list \
|
[list \
|
||||||
"Build libsize-9.so" \
|
"Build libsize-9.so" \
|
||||||
"-shared" \
|
"-shared $NOSANTIZE_CFLAGS" \
|
||||||
"-fPIC" \
|
"-fPIC $NOSANTIZE_CFLAGS" \
|
||||||
{size-9b.c} \
|
{size-9b.c} \
|
||||||
{{readelf -rW size-9.rd}} \
|
{{readelf -rW size-9.rd}} \
|
||||||
"libsize-9.so" \
|
"libsize-9.so" \
|
||||||
@ -284,11 +284,12 @@ run_ld_link_exec_tests [list \
|
|||||||
] \
|
] \
|
||||||
[list \
|
[list \
|
||||||
"Run size-9" \
|
"Run size-9" \
|
||||||
"-Wl,--no-as-needed tmpdir/libsize-9.so" \
|
"-Wl,--no-as-needed tmpdir/libsize-9.so $NOSANTIZE_CFLAGS" \
|
||||||
"" \
|
"" \
|
||||||
{size-9a.c} \
|
{size-9a.c} \
|
||||||
"size-9" \
|
"size-9" \
|
||||||
"size-9.out" \
|
"size-9.out" \
|
||||||
|
"$NOSANTIZE_CFLAGS" \
|
||||||
] \
|
] \
|
||||||
[list \
|
[list \
|
||||||
"Run size-10" \
|
"Run size-10" \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user