This is the mail archive of the
mailing list for the binutils project.
Re: RFC: binutils PATCH: Set e_type to ET_EXEC for -pie -Ttext-segment=
- From: "H. Peter Anvin" <hpa at zytor dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>, Jiri Kosina <jkosina at suse dot cz>, LKML <linux-kernel at vger dot kernel dot org>, Josh Boyer <jwboyer at redhat dot com>
- Date: Tue, 10 Dec 2013 11:08:20 -0800
- Subject: Re: RFC: binutils PATCH: Set e_type to ET_EXEC for -pie -Ttext-segment=
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOrKGSxr9X5txGq2Js0vGwXdwxPT+ip70-YZs-Wz-aPgQg at mail dot gmail dot com>
On 12/10/2013 04:20 AM, H.J. Lu wrote:
> On Mon, Dec 9, 2013 at 8:57 PM, H. Peter Anvin <firstname.lastname@example.org> wrote:
>> Where do the _32 and _32S relocations come from? Are we mixing multiple things inside -pie?
> They come from crt1.o and crtbegin.o. -pie uses Scrt1.o and crtbeginS.o.
OK, so this is fundamentally an issue with the gcc wrapper... there
isn't a way to get the relocatable crt files without telling the linker
to link PIE (except perhaps using some -Wl option, maybe "-Wl,-no-pie"?)
Either way, if the *only* goal is to get the file above a certain point,
like 4 GiB, then there is no reason not to randomize upward.