From: Alan Modra Date: Fri, 28 Aug 2020 01:21:28 +0000 (+0930) Subject: mingw plugin test regressions due to commit 514b4e191d5f X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16f9c644c7fcec6f4aa6f4e8a1458b57d2b28982;p=binutils-gdb.git 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. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 787d7605f5d..824e00de5f1 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,9 @@ +2020-08-28 Alan Modra + + PR 19011 + * testsuite/ld-plugin/plugin.exp: Use modified CFLAGS throughout + file. Add --image-base for pecoff. + 2020-08-28 Nelson Chu testsuite/ld-riscv-elf/lib-nopic-01a.s: Use R_RISCV_JAL rather diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index 5f6f21af205..88817ed7531 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -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"