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 {
|
2014-12-01 18:04:10 +01:00
|
|
|
@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then
|
2012-09-14 14:12:28 +02:00
|
|
|
catch "exec ln -s ld tmpdir/ld/collect-ld" status
|
2014-12-01 18:04:10 +01:00
|
|
|
catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
|
2007-10-09 04:28:58 +02:00
|
|
|
}
|
2014-12-01 18:04:10 +01:00
|
|
|
-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
|
|
|
set ld_L_opt ""
|
|
|
|
@@ -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
|
|
|
|
@@ -78,7 +78,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.
|
|
|
|
- if {$ld != "$objdir/ld-new"} {
|
|
|
|
+ set ldexe $ld
|
|
|
|
+ set ldparm [string first " " $ld]
|
|
|
|
+ if { $ldparm > 0 } then {
|
|
|
|
+ set ldexe [string range $ld 0 $ldparm]
|
|
|
|
+ }
|
|
|
|
+ if {$ldexe != "$objdir/ld-new"} {
|
|
|
|
untested $testname
|
|
|
|
continue
|
|
|
|
}
|