[PATCH 0/6] ld: Add "-z textonly" option to ELF linker

Alan Modra amodra@gmail.com
Tue Jan 9 13:21:00 GMT 2018

On Mon, Jan 08, 2018 at 08:10:53AM -0800, H.J. Lu wrote:
> On Mon, Jan 8, 2018 at 7:26 AM, Michael Matz <matz@suse.de> wrote:
> > supposed to mean? :)  -z separate-text-segment perhaps?
> -z codeonly -or z insnonly?

-z separate-code perhaps?

Regarding the implementation, I'm wondering why you didn't implement
the vma adjustments entirely in the new linker scripts.  It seems like
this ought to be possible.

You're stuck with multiple new PT_LOAD segments.  The R, RE, R, RW
order is necessary because the first R must cover the ELF header, and
the second R is needed for relro support (but you might be able to
reorder sections to get R, RE, RW for non-relro).

Alan Modra
Australia Development Lab, IBM

More information about the Binutils mailing list