1 diff -Nur binutils-2.22.52.0.4-vanilla/ld/emultempl/armelf.em binutils-2.22.52.0.4/ld/emultempl/armelf.em
2 --- binutils-2.22.52.0.4-vanilla/ld/emultempl/armelf.em 2012-06-05 18:44:10.000000000 +0200
3 +++ binutils-2.22.52.0.4/ld/emultempl/armelf.em 2012-06-08 13:34:30.578427241 +0200
5 input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
6 config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
7 config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
8 + link_info.relro = TRUE;
12 diff -Nur binutils-2.22.52.0.4-vanilla/ld/emultempl/elf32.em binutils-2.22.52.0.4/ld/emultempl/elf32.em
13 --- binutils-2.22.52.0.4-vanilla/ld/emultempl/elf32.em 2012-06-05 18:44:10.000000000 +0200
14 +++ binutils-2.22.52.0.4/ld/emultempl/elf32.em 2012-06-08 13:33:07.090612102 +0200
16 input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
17 config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
18 link_info.sharable_sections = `if test "$SHARABLE_SECTIONS" = "yes" ; then echo TRUE ; else echo FALSE ; fi`;
19 + link_info.relro = TRUE;
23 diff -Nur binutils-2.22.52.0.4-vanilla/ld/testsuite/config/default.exp binutils-2.22.52.0.4/ld/testsuite/config/default.exp
24 --- binutils-2.22.52.0.4-vanilla/ld/testsuite/config/default.exp 2012-06-05 18:44:10.000000000 +0200
25 +++ binutils-2.22.52.0.4/ld/testsuite/config/default.exp 2012-06-08 13:33:07.085612052 +0200
29 if ![info exists ld] then {
30 - set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
31 + set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
34 if ![info exists as] then {
36 catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
37 catch "exec ln -s ld tmpdir/ld/collect-ld" status
39 -set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
40 +set gcc_ld_flag "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
42 # load the linker path
43 if {[file exists tmpdir/libpath.exp]} {
47 if ![info exists LD] then {
48 - set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
49 + set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
52 if ![info exists LDFLAGS] then {
53 diff -Nur binutils-2.22.52.0.4-vanilla/ld/testsuite/ld-bootstrap/bootstrap.exp binutils-2.22.52.0.4/ld/testsuite/ld-bootstrap/bootstrap.exp
54 --- binutils-2.22.52.0.4-vanilla/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-06-05 18:44:10.000000000 +0200
55 +++ binutils-2.22.52.0.4/ld/testsuite/ld-bootstrap/bootstrap.exp 2012-06-08 13:33:07.086612062 +0200
58 # This test can only be run if we have the ld build directory,
59 # since we need the object files.
60 - if {$ld != "$objdir/ld-new"} {
62 + set ldparm [string first " " $ld]
63 + if { $ldparm > 0 } then {
64 + set ldparm [expr $ldparm - 1]
65 + set ldexe [string range $ld 0 $ldparm]
67 + if {$ldexe != "$objdir/ld-new"} {