[SECURITY] Merged .text and .rodata in linker scripts

Ian Lance Taylor iant@google.com
Tue May 13 17:17:00 GMT 2014


On Tue, May 13, 2014 at 9:14 AM, Stefan Nürnberger
<nuernberger@cs.uni-saarland.de> wrote:
>
> My solution to this (see attached linker script) separates read-only
> data from executable data and puts them in separate sections (.rodata
> and .text). To overcome the issue that the ELF header is part of
> executable data, the .rodata section is the first section to be loaded,
> thereby making the ELF header part of .rodata, which means it is still
> accessible, e.g. for routines that iterate over PHDRs.

FYI gold uses the --rosegment option for a similar feature.  Ideally
GNU ld would be compatible.

Ian



More information about the Binutils mailing list