diff options
author | Alan Modra <amodra@gmail.com> | 2020-08-28 10:51:28 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-08-28 13:12:20 +0930 |
commit | 16f9c644c7fcec6f4aa6f4e8a1458b57d2b28982 (patch) | |
tree | cd4c4e2537bcaabb2afee9d9893b47cc44aef5f1 | |
parent | 3b1450b38c644f99aa2e211747b428b9f8d15cca (diff) | |
download | gdb-16f9c644c7fcec6f4aa6f4e8a1458b57d2b28982.zip gdb-16f9c644c7fcec6f4aa6f4e8a1458b57d2b28982.tar.gz gdb-16f9c644c7fcec6f4aa6f4e8a1458b57d2b28982.tar.bz2 |
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.
-rw-r--r-- | ld/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-plugin/plugin.exp | 15 |
2 files changed, 17 insertions, 4 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 787d760..824e00d 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -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 diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index 5f6f21a..88817ed 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" |