2009-11-27 12:33:30 +01:00
|
|
|
Index: ld/lexsup.c
|
|
|
|
===================================================================
|
|
|
|
--- ld/lexsup.c.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/lexsup.c 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -687,6 +687,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
|
|
|
|
===================================================================
|
|
|
|
--- ld/testsuite/config/default.exp.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/testsuite/config/default.exp 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -23,7 +23,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 {
|
2009-11-27 12:33:30 +01:00
|
|
|
@@ -68,7 +68,7 @@ if {![file isdirectory tmpdir/ld]} then
|
2007-10-09 04:28:58 +02:00
|
|
|
catch "exec mkdir tmpdir/ld" status
|
|
|
|
catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
|
|
|
|
}
|
|
|
|
-set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
|
|
|
|
+set gcc_ld_flag "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
|
|
|
|
|
|
|
|
# load the linker path
|
|
|
|
if {[file exists tmpdir/libpath.exp]} {
|
2009-11-27 12:33:30 +01:00
|
|
|
@@ -270,7 +270,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
|
|
|
|
===================================================================
|
|
|
|
--- ld/testsuite/ld-bootstrap/bootstrap.exp.orig 2009-11-23 14:02:48.000000000 +0100
|
|
|
|
+++ ld/testsuite/ld-bootstrap/bootstrap.exp 2009-11-23 14:03:09.000000000 +0100
|
|
|
|
@@ -56,7 +56,12 @@ foreach flags {"" "strip" "--static" "--
|
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
|
|
|
|
}
|