2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/lexsup.c
|
|
|
|
===================================================================
|
2014-12-01 18:04:10 +01:00
|
|
|
--- ld/lexsup.c.orig 2014-10-14 17:43:07.000000000 +0200
|
|
|
|
+++ ld/lexsup.c 2014-10-14 17:43:26.000000000 +0200
|
|
|
|
@@ -623,6 +623,9 @@ parse_args (unsigned argc, char **argv)
|
2007-10-09 04:28:58 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ optarg = "relro";
|
|
|
|
+ ldemul_handle_option ('z');
|
|
|
|
+
|
|
|
|
last_optind = -1;
|
|
|
|
while (1)
|
|
|
|
{
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/testsuite/config/default.exp
|
|
|
|
===================================================================
|
2014-12-01 18:04:10 +01:00
|
|
|
--- ld/testsuite/config/default.exp.orig 2014-10-14 17:43:07.000000000 +0200
|
|
|
|
+++ ld/testsuite/config/default.exp 2014-10-14 17:44:58.000000000 +0200
|
|
|
|
@@ -22,7 +22,7 @@
|
2007-10-09 04:28:58 +02:00
|
|
|
#
|
|
|
|
|
|
|
|
if ![info exists ld] then {
|
|
|
|
- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
|
|
|
|
+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
|
|
|
|
}
|
|
|
|
|
|
|
|
if ![info exists as] then {
|
2023-01-24 16:25:48 +01:00
|
|
|
@@ -70,7 +70,7 @@ if {[info exists ld_testsuite_bindir]} {
|
|
|
|
catch "exec ln -s ld tmpdir/ld/collect-ld" status
|
|
|
|
catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
|
|
|
|
}
|
|
|
|
- set gcc_B_opt "-B[pwd]/tmpdir/ld/"
|
|
|
|
+ set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
|
2007-10-09 04:28:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# load the linker path
|
2014-12-01 18:04:10 +01:00
|
|
|
@@ -272,7 +272,7 @@ if ![info exists READELFFLAGS] then {
|
2007-10-09 04:28:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if ![info exists LD] then {
|
|
|
|
- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
|
|
|
|
+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
|
|
|
|
}
|
|
|
|
|
|
|
|
if ![info exists LDFLAGS] then {
|
2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/testsuite/ld-bootstrap/bootstrap.exp
|
|
|
|
===================================================================
|
2014-12-01 18:04:10 +01:00
|
|
|
--- ld/testsuite/ld-bootstrap/bootstrap.exp.orig 2014-10-14 17:43:07.000000000 +0200
|
|
|
|
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 2014-10-14 17:43:26.000000000 +0200
|
2023-01-24 16:25:48 +01:00
|
|
|
@@ -106,7 +106,12 @@ foreach flags $test_flags {
|
2007-10-09 04:28:58 +02:00
|
|
|
|
|
|
|
# This test can only be run if we have the ld build directory,
|
|
|
|
# since we need the object files.
|
2023-01-24 16:25:48 +01:00
|
|
|
- if {[file normalize $ld] != [file normalize $objdir/ld-new]} {
|
2007-10-09 04:28:58 +02:00
|
|
|
+ set ldexe $ld
|
|
|
|
+ set ldparm [string first " " $ld]
|
|
|
|
+ if { $ldparm > 0 } then {
|
|
|
|
+ set ldexe [string range $ld 0 $ldparm]
|
|
|
|
+ }
|
2023-01-24 16:25:48 +01:00
|
|
|
+ if {[file normalize $ldexe] != [file normalize $objdir/ld-new]} {
|
2007-10-09 04:28:58 +02:00
|
|
|
untested $testname
|
|
|
|
continue
|
|
|
|
}
|