mingw plugin test regressions due to commit 514b4e191d5f

Fixes new failures due to image base change.

	PR 19011
	* testsuite/ld-plugin/plugin.exp: Use modified CFLAGS throughout
	file.  Add --image-base for pecoff.
This commit is contained in:
Alan Modra 2020-08-28 10:51:28 +09:30
parent 3b1450b38c
commit 16f9c644c7
2 changed files with 17 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2020-08-28 Alan Modra <amodra@gmail.com>
PR 19011
* testsuite/ld-plugin/plugin.exp: Use modified CFLAGS throughout
file. Add --image-base for pecoff.
2020-08-28 Nelson Chu <nelson.chu@sifive.com>
testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather

View File

@ -95,6 +95,7 @@ set _ ""
set plugin_nm_output ""
set old_CFLAGS "$CFLAGS"
append CFLAGS " $NOSANTIZE_CFLAGS"
if { $can_compile && \
(![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o] \
|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o] \
@ -105,7 +106,6 @@ if { $can_compile && \
# Defer fail until we have list of tests set.
set failed_compile 1
}
set CFLAGS "$old_CFLAGS"
set dotsym 0
if { $can_compile && !$failed_compile } {
@ -129,6 +129,10 @@ set libs "[ld_link_defsyms] --defsym ${_}printf=${_}main --defsym ${_}puts=${_}m
if { $dotsym } {
append libs " --defsym .printf=.main --defsym .puts=.main"
}
if [is_pecoff_format] {
#otherwise relocs overflow to symbols defined on the command line
append libs " --image-base=0x10000000"
}
set plugin_tests [list \
[list "load plugin" "-plugin $plugin_path \
@ -289,15 +293,16 @@ if { !$can_compile || $failed_compile } {
$failure_kind [lindex $testitem 0]
}
}
set CFLAGS "$old_CFLAGS"
return
}
run_ld_link_tests $plugin_tests
if { [is_elf_format] \
&& [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
&& [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
&& [ld_compile "$CC $CFLAGS $NOSANTIZE_CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \
&& [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } {
run_ld_link_tests $plugin_extra_elf_tests
}
@ -390,3 +395,5 @@ if [ar_simple_create $ar "--plugin $plugin4_path" "tmpdir/libpr20070.a" \
} else {
unresolved "PR ld/20070"
}
set CFLAGS "$old_CFLAGS"