global CFLAGS
global runtests
global exec_output
- global ld_elf_shared_opt
- if { [is_elf_format] && [check_shared_lib_support] } {
- set ld_extra_opt "$ld_elf_shared_opt"
- } else {
- set ld_extra_opt ""
+ set ld_extra_opt ""
+ if [check_relro_support] {
+ set ld_extra_opt "-z norelro"
}
foreach testitem $ldtests {
verbose "$exec_output" 1
set failed 1
} else {
- send_log "diff $binfile.out $srcdir/$subdir/$expfile\n"
- verbose "diff $binfile.out $srcdir/$subdir/$expfile"
- catch "exec diff $binfile.out $srcdir/$subdir/$expfile" exec_output
- set exec_output [prune_warnings $exec_output]
-
- if ![string match "" $exec_output] then {
- send_log "$exec_output\n"
- verbose "$exec_output" 1
+ send_log [file_contents $binfile.out]
+ verbose [file_contents $binfile.out] 2
+ if [regexp_diff "$binfile.out" "$srcdir/$subdir/$expfile"] {
set failed 1
}
}
if { $binfile eq "tmpdir/" } {
# compile only
+ set binfile $objfile
} elseif { [regexp ".*\\.a$" $binfile] } {
if { ![ar_simple_create $ar $ldflags $binfile "$objfiles"] } {
set failed 1
|| [istarget pj*-*-*]
|| [istarget pru*-*-*]
|| [istarget s12z-*-*]
- || [istarget xgate-*-*] } {
+ || [istarget xgate-*-*]
+ || [istarget z80-*-*] } {
set gc_sections_available_saved 0
return 0
}
if {![info exists plugin_api_available_saved]} {
# Check if the ld used by gcc supports --plugin.
set ld_output [remote_exec host $ld "--help"]
- if { [ string first "-plugin PLUGIN" $ld_output ] >= 0 } {
+ if { [regexp -- "-plugin PLUGIN \[^\n\r\]*" $ld_output line]
+ && ![regexp "ignored" $line] } {
set plugin_api_available_saved 1
} else {
set plugin_api_available_saved 0