summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-10-30 12:43:07 -0700
committerVyacheslav Barinov <v.barinov@samsung.com>2015-02-16 10:34:03 +0300
commit52248d53383e2ff905bacb46b1c24c89b64ab42e (patch)
tree84aa451bc18207c5d1e60974a666f3641fca29c1
parentffb1a5e41d6e859f5876904d614105727b03f9a2 (diff)
downloadbinutils-52248d53383e2ff905bacb46b1c24c89b64ab42e.tar.gz
binutils-52248d53383e2ff905bacb46b1c24c89b64ab42e.tar.bz2
binutils-52248d53383e2ff905bacb46b1c24c89b64ab42e.zip
ld relro
-rw-r--r--ld/lexsup.c3
-rw-r--r--ld/testsuite/config/default.exp6
-rw-r--r--ld/testsuite/ld-bootstrap/bootstrap.exp7
3 files changed, 12 insertions, 4 deletions
diff --git a/ld/lexsup.c b/ld/lexsup.c
index 4812c97b32d..082a3288772 100644
--- a/ld/lexsup.c
+++ b/ld/lexsup.c
@@ -625,6 +625,9 @@ parse_args (unsigned argc, char **argv)
}
}
+ optarg = "relro";
+ ldemul_handle_option ('z');
+
last_optind = -1;
while (1)
{
diff --git a/ld/testsuite/config/default.exp b/ld/testsuite/config/default.exp
index 09b262684e9..aa6c13ddfab 100644
--- a/ld/testsuite/config/default.exp
+++ b/ld/testsuite/config/default.exp
@@ -22,7 +22,7 @@
#
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 {
@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then {
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"
# load the linker path
set ld_L_opt ""
@@ -272,7 +272,7 @@ if ![info exists READELFFLAGS] then {
}
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 {
diff --git a/ld/testsuite/ld-bootstrap/bootstrap.exp b/ld/testsuite/ld-bootstrap/bootstrap.exp
index bbd4fd87ba8..ccb07d5eb93 100644
--- a/ld/testsuite/ld-bootstrap/bootstrap.exp
+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp
@@ -78,7 +78,12 @@ foreach flags $test_flags {
# 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
}