+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
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] \
# 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 } {
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 \
$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
}
} else {
unresolved "PR ld/20070"
}
+
+set CFLAGS "$old_CFLAGS"