[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: Audit external function called indirectly via GOT



On Thu, Mar 22, 2018 at 5:29 AM, Alan Modra <amodra@gmail.com> wrote:
> On Wed, Mar 21, 2018 at 10:15:26PM -0700, Cary Coutant wrote:
>> If you get rid of the GOT entry, and have the point of call jump
>> indirectly through the PLTGOT entry, which is initialized to point to
>> part (b) of the PLT entry, everything should work the same as without
>> -fno-plt. Essentially, all -fno-plt would do is inline part (a) of the
>> PLT entry.
>>
>> -cary
>>
>> * I'm using parts (a) and (b) to refer to the two parts of a PLT
>> entry: (a) an indirect jump via the PLTGOT entry, and (b) code that
>> jumps to the lazy binding routine, passing the JUMP_SLOT index.
>
> Yes, that essentially is what I've done for -fno-plt on powerpc.
> The call stub code is inlined while the rest of the PLT is more or
> less unchanged.  So you get all of the usual lazy-binding features
> by default, and can use "-z now -z relro" if you want a read-only
> PLT.
>

On x86, PLT is always read-only.  The issue is the writable PLTGOT.
On x86, -fno-plt removes the writable PLTGOT.  My proposal puts
back the writable PLTGOT which is only used for LD_AUDIT.

-- 
H.J.