This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Enable relro by default for AArch64, ARM and SCORE.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=576438f0fa3ecbe0b49b3bcc2f028d586d198247

commit 576438f0fa3ecbe0b49b3bcc2f028d586d198247
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Aug 19 09:27:52 2016 +0100

    Enable relro by default for AArch64, ARM and SCORE.
    
    ld	* emultempl/aarch64elf.em (before_parse): Initialise the relro
    	field in the link_info structure.
    	* emultempl/armelf.em (before_parse): Likewise.
    	* emultempl/linux.em (before_parse): Likewise.
    	* emultempl/scoreelf.em (before_parse): Likewise.

Diff:
---
 ld/ChangeLog               | 6 ++++++
 ld/emultempl/aarch64elf.em | 1 +
 ld/emultempl/armelf.em     | 1 +
 ld/emultempl/linux.em      | 1 +
 ld/emultempl/scoreelf.em   | 1 +
 5 files changed, 10 insertions(+)

diff --git a/ld/ChangeLog b/ld/ChangeLog
index f75c42c..34cdf77 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,5 +1,11 @@
 2016-08-19  Nick Clifton  <nickc@redhat.com>
 
+	* emultempl/aarch64elf.em (before_parse): Initialise the relro
+	field in the link_info structure.
+	* emultempl/armelf.em (before_parse): Likewise.
+	* emultempl/linux.em (before_parse): Likewise.
+	* emultempl/scoreelf.em (before_parse): Likewise.
+
 	* testsuite/ld-alpha/tlsbin.rd: Adjust expected ordering of sections.
 	* testsuite/ld-alpha/tlsbinr.rd: Likewise.
 	* testsuite/ld-alpha/tlspic.rd: Likewise.
diff --git a/ld/emultempl/aarch64elf.em b/ld/emultempl/aarch64elf.em
index a17553a..9f2c349 100644
--- a/ld/emultempl/aarch64elf.em
+++ b/ld/emultempl/aarch64elf.em
@@ -43,6 +43,7 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
+  link_info.relro = DEFAULT_LD_Z_RELRO;
 }
 
 static void
diff --git a/ld/emultempl/armelf.em b/ld/emultempl/armelf.em
index c21f6a8..2678740 100644
--- a/ld/emultempl/armelf.em
+++ b/ld/emultempl/armelf.em
@@ -53,6 +53,7 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
+  link_info.relro = DEFAULT_LD_Z_RELRO;
 }
 
 static void
diff --git a/ld/emultempl/linux.em b/ld/emultempl/linux.em
index c28e978..64a9130 100644
--- a/ld/emultempl/linux.em
+++ b/ld/emultempl/linux.em
@@ -50,6 +50,7 @@ gld${EMULATION_NAME}_before_parse (void)
   ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   input_flags.dynamic = TRUE;
   config.has_shared = TRUE;
+  link_info.relro = DEFAULT_LD_Z_RELRO;
 }
 
 /* Try to open a dynamic archive.  This is where we know that Linux
diff --git a/ld/emultempl/scoreelf.em b/ld/emultempl/scoreelf.em
index 6433365..7df7f5f 100644
--- a/ld/emultempl/scoreelf.em
+++ b/ld/emultempl/scoreelf.em
@@ -39,6 +39,7 @@ gld${EMULATION_NAME}_before_parse (void)
   input_flags.dynamic = ${DYNAMIC_LINK-TRUE};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
   config.separate_code = `if test "x${SEPARATE_CODE}" = xyes ; then echo TRUE ; else echo FALSE ; fi`;
+  link_info.relro = DEFAULT_LD_Z_RELRO;
 }
 
 static void


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]