]> git.ipfire.org Git - ipfire-3.x.git/blame - binutils/patches/binutils-2.22.52.0.1-relro-on-by-default.patch
binutils: Update to 2.26
[ipfire-3.x.git] / binutils / patches / binutils-2.22.52.0.1-relro-on-by-default.patch
CommitLineData
ea5329d6
MT
1diff -upr ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp ld/testsuite/config/default.exp
2--- a/ld/testsuite/config/default.exp 2012-03-06 14:00:31.141957656 +0000
3+++ b/ld/testsuite/config/default.exp 2012-03-06 14:09:33.492940503 +0000
4@@ -23,7 +23,7 @@
5 #
6
7 if ![info exists ld] then {
8- set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
9+ set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
10 }
11
12 if ![info exists as] then {
13@@ -60,7 +60,7 @@ if {![file isdirectory tmpdir/ld]} then
14 catch "exec ln -s ld tmpdir/ld/collect-ld" status
15 catch "exec ln -s ../../../gas/as-new tmpdir/ld/as" status
16 }
17-set gcc_B_opt "-B[pwd]/tmpdir/ld/"
18+set gcc_B_opt "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
19
20 # load the linker path
21 set ld_L_opt ""
22@@ -279,7 +279,7 @@
23 }
24
25 if ![info exists LD] then {
26- set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
27+ set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
28 }
29
30 if ![info exists LDFLAGS] then {
31diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp ld/testsuite/ld-bootstrap/bootstrap.exp
32--- a/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 14:00:30.503957676 +0000
33+++ b/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-03-06 15:03:33.949837926 +0000
34@@ -71,7 +71,13 @@
35
36 # This test can only be run if we have the ld build directory,
37 # since we need the object files.
38- if {$ld != "$objdir/ld-new"} {
39+ set ldexe $ld
40+ set ldparm [string first " " $ld]
41+ if { $ldparm > 0 } then {
42+ set ldparm [expr $ldparm - 1]
43+ set ldexe [string range $ld 0 $ldparm]
44+ }
45+ if {$ldexe != "$objdir/ld-new"} {
46 untested $testname
47 continue
48 }
49--- binutils-2.26.orig/ld/emultempl/elf32.em 2016-01-25 10:11:33.990291993 +0000
50+++ binutils-2.26/ld/emultempl/elf32.em 2016-01-25 10:21:40.333016777 +0000
51@@ -104,6 +104,7 @@ gld${EMULATION_NAME}_before_parse (void)
52 config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
53 config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
54 `if test -n "$CALL_NOP_BYTE" ; then echo link_info.call_nop_byte = $CALL_NOP_BYTE; fi`;
55+ link_info.relro = TRUE;
56 }
57
58 EOF