lkml.org 
[lkml]   [2013]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] binfmt_elf: fix PIE load with randomization disabled
From
On Mon, Dec 9, 2013 at 4:37 PM, H. Peter Anvin <hpa@zytor.com> wrote:
> On 12/09/2013 03:53 PM, H.J. Lu wrote:
>>>>
>>>> x86-64 small model is limited to 4GB in size. You can't build
>>>> a dynamic executable in small model larger than 4GB.
>>>>
>>>> There are medium and large models. But they are slower than
>>>> small models as well as small models in PIE. Also there are
>>>> no glibc run-times for medium and large models.
>>>>
>>> Compiling for the small PIC model shouldn't automatically mean
>>> generating a PIE (ET_DYN) executable, though (and if those are
>>> inherently linked, that is a fundamental bug IMNSHO.)
>>
>> PIE uses PIC. But GCC has -fPIE and -fPIC. They aren't
>> the same. You build PIE with
>>
>> 1. Compile with -fPIE.
>> 2. Link with -pie.
>>
>
> I'm talking about the memory model ("small PIC model"). I don't see why
> it should be encapsulated in a PIE (ET_DYN) container if the user
> doesn't want it to be relocatable.
>

I see. Maybe linker can set ET_EXEC if vaddr is non-zero.


--
H.J.


\
 
 \ /
  Last update: 2013-12-10 02:01    [W:0.119 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site