Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2016 17:50:31 -0500
From:      Pedro Giffuni <pfg@FreeBSD.org>
To:        freebsd-toolchain@FreeBSD.org
Subject:   Time to enable partial relro
Message-ID:  <b75890eb-d8bd-759e-002f-ab0c16db0975@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------B7BF4F72F4202B122F41AEA1
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Hello;

GNU RELRO support was committed in r230784 (2012-01-30) but we never 
enabled it by default.

There was some discussion about it on
https://reviews.freebsd.org/D3001

By now, all Linux distributions, NetBSD and DragonFly support it and
it is the default for most systems in binutils 2.27.

This doesn't affect performance, I ran it through an exp-run last
year, no other OS has had issues etc ... seems safe and can be
disabled if needed when linking.

I think it's time to enable it be default in our base binutils. If
there are no objections, I will just commit the attached patch over
the weekend.

Regards,

Pedro.

--------------B7BF4F72F4202B122F41AEA1
Content-Type: text/x-patch;
 name="partial-relro.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="partial-relro.diff"

Index: contrib/binutils/ld/emultempl/elf32.em
===================================================================
--- contrib/binutils/ld/emultempl/elf32.em	(revision 304807)
+++ contrib/binutils/ld/emultempl/elf32.em	(working copy)
@@ -97,6 +97,7 @@
   ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
   config.dynamic_link = ${DYNAMIC_LINK-TRUE};
   config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo TRUE ; else echo FALSE ; fi`;
+  link_info.relro = TRUE;
 }
 
 EOF

--------------B7BF4F72F4202B122F41AEA1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b75890eb-d8bd-759e-002f-ab0c16db0975>