6b2ab95
diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp ld/testsuite/config/default.exp
6b2ab95
*** ../binutils-2.22.52.0.1.orig/ld/testsuite/config/default.exp	2012-03-06 14:00:31.141957656 +0000
6b2ab95
--- ld/testsuite/config/default.exp	2012-03-06 14:09:33.492940503 +0000
6b2ab95
***************
6b2ab95
*** 23,29 ****
6b2ab95
  #
6b2ab95
  
6b2ab95
  if ![info exists ld] then {
6b2ab95
!     set ld [findfile $base_dir/ld-new $base_dir/ld-new [transform ld]]
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists as] then {
6b2ab95
--- 23,29 ----
6b2ab95
  #
6b2ab95
  
6b2ab95
  if ![info exists ld] then {
6b2ab95
!     set ld "[findfile $base_dir/ld-new $base_dir/ld-new [transform ld]] -znorelro"
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists as] then {
6b2ab95
*************** if {![file isdirectory tmpdir/ld]} then
6b2ab95
*** 69,75 ****
6b2ab95
      catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
6b2ab95
      catch "exec ln -s ld tmpdir/ld/collect-ld" status
6b2ab95
  }
6b2ab95
! set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
6b2ab95
  
6b2ab95
  # load the linker path
6b2ab95
  if {[file exists tmpdir/libpath.exp]} {
6b2ab95
--- 69,75 ----
6b2ab95
      catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
6b2ab95
      catch "exec ln -s ld tmpdir/ld/collect-ld" status
6b2ab95
  }
6b2ab95
! set gcc_ld_flag "-B[pwd]/tmpdir/ld/ -Wl,-z,norelro"
6b2ab95
  
6b2ab95
  # load the linker path
6b2ab95
  if {[file exists tmpdir/libpath.exp]} {
6b2ab95
*************** if ![info exists READELFFLAGS] then {
6b2ab95
*** 279,285 ****
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists LD] then {
6b2ab95
!     set LD [findfile $base_dir/ld-new ./ld-new [transform ld]]
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists LDFLAGS] then {
6b2ab95
--- 279,285 ----
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists LD] then {
6b2ab95
!     set LD "[findfile $base_dir/ld-new ./ld-new [transform ld]] -znorelro"
6b2ab95
  }
6b2ab95
  
6b2ab95
  if ![info exists LDFLAGS] then {
6b2ab95
diff -cpr ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp ld/testsuite/ld-bootstrap/bootstrap.exp
6b2ab95
*** ../binutils-2.22.52.0.1.orig/ld/testsuite/ld-bootstrap/bootstrap.exp	2012-03-06 14:00:30.503957676 +0000
6b2ab95
--- ld/testsuite/ld-bootstrap/bootstrap.exp	2012-03-06 15:03:33.949837926 +0000
6b2ab95
*************** foreach flags {"" "strip" "--static" "--
6b2ab95
*** 71,77 ****
6b2ab95
  
6b2ab95
      # This test can only be run if we have the ld build directory,
6b2ab95
      # since we need the object files.
6b2ab95
!     if {$ld != "$objdir/ld-new"} {
6b2ab95
  	untested $testname
6b2ab95
  	continue
6b2ab95
      }
6b2ab95
--- 71,83 ----
6b2ab95
  
6b2ab95
      # This test can only be run if we have the ld build directory,
6b2ab95
      # since we need the object files.
6b2ab95
!     set ldexe $ld
6b2ab95
!     set ldparm [string first " " $ld]
6b2ab95
!     if { $ldparm > 0 } then {
6b2ab95
! 	set ldparm [expr $ldparm - 1]
6b2ab95
! 	set ldexe [string range $ld 0 $ldparm]
6b2ab95
!     }
6b2ab95
!     if {$ldexe != "$objdir/ld-new"} {
6b2ab95
  	untested $testname
6b2ab95
  	continue
6b2ab95
      }
7a34068
*** ../binutils-2.23.2.orig/ld/emultempl/elf32.em	2013-04-24 11:06:47.777176887 +0100
7a34068
--- ld/emultempl/elf32.em	2013-04-24 11:07:22.405177847 +0100
f3ebd32
*************** gld${EMULATION_NAME}_before_parse (void)
7a34068
*** 105,110 ****
7a34068
--- 105,111 ----
7a34068
    input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
f3ebd32
    config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
e35c5a1
    config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
f3ebd32
+   link_info.relro = TRUE;
f3ebd32
  }
f3ebd32
  
f3ebd32
  EOF