Best way to make partial relro by default?

Pedro Giffuni pfg@FreeBSD.org
Mon Sep 28 18:47:00 GMT 2015


Hello;

On 09/28/15 11:40, Mike Frysinger wrote:
> On 28 Sep 2015 11:31, Pedro Giffuni wrote:
>> I noticed many linux distributions are making partial RELRO the default:
>> https://bugzilla.redhat.com/show_bug.cgi?id=807831
>>
>> Some set it as the default in ld [1] some others set it in the gcc
>> specs. What would be the "blessed" way to do this for all the
>> distribution?
>
> Gentoo has been doing this for about 9 years in the linker.  current:
> https://sources.gentoo.org/gentoo/src/patchsets/binutils/2.25.1/78_all_use-relro.patch
>

Ah yes, it is usually done in ld/ldmain.c or in ld/emultempl/elf32.em

>> Any chance to see this standardized in the GNU toolchain, perhaps in ld?
>
> i think a configure flag in ld/ and gold/ would be appropriate here

I think so too, I find it more practical than modifying GCC and clang.

the default can of course still be disabled so I would like to see such
change upstreamed instead of seeing every distribution setting it on 
it's own.

Unless there are downsides that I may not understand :-/.

Pedro.



More information about the Binutils mailing list