This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH 0/6] ld: Add "-z textonly" option to ELF linker
On Tue, Jan 9, 2018 at 5:21 AM, Alan Modra <amodra@gmail.com> wrote:
> 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?
Done. I updated to -z separate-code on users/hjl/pr22393 branch.
> 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.
It may be doable without RELRO. My current approach is built on top
of RELRO. Maybe I missed something. Can you show me how to do
it entirely in linker scripts?
> You're stuck with multiple new 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).
>
In my implementation, -z norelro implies -z noseparate-code.
--
H.J.