+proc check_relro_support { } {
+ global relro_available_saved
+ global ld
+
+ if {![info exists relro_available_saved]} {
+ remote_file host delete norelro
+ set ld_output [remote_exec host $ld "-z norelro"]
+ if { [string first "not supported" $ld_output] >= 0
+ || [string first "unrecognized option" $ld_output] >= 0
+ || [string first "-z norelro ignored" $ld_output] >= 0
+ || [string first "cannot find norelro" $ld_output] >= 0 } {
+ set relro_available_saved 0
+ } else {
+ set relro_available_saved 1
+ }
+ }
+ return $relro_available_saved
+}
+