This is the mail archive of the
mailing list for the binutils project.
Re: [SECURITY] Merged .text and .rodata in linker scripts
- From: Ian Lance Taylor <iant at google dot com>
- To: Stefan NÃrnberger <nuernberger at cs dot uni-saarland dot de>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 13 May 2014 10:17:42 -0700
- Subject: Re: [SECURITY] Merged .text and .rodata in linker scripts
- Authentication-results: sourceware.org; auth=none
- References: <537244F1 dot 6090404 at cs dot uni-saarland dot de>
On Tue, May 13, 2014 at 9:14 AM, Stefan NÃrnberger
> 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.