[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 10:15 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> On Thu, Mar 22, 2018 at 9:47 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
>>> * Carlos O'Donell:
>>>
>>>> Well, Levin's "Linker's and Loaders"
>>>> https://www.iecc.com/linker/linker10.html, is the immediate reference
>>>> that I have on my shelf, and that developers working on glibc/binutils
>>>> should read.
>>>
>>> Thanks, I didn't know that.
>>>
>>>>> My understanding is that H.J.'s proposal requires changes when running
>>>>> in non-audit mode.  It certainly requires relinking all binaries,
>>>>> perhaps even with special flags.
>>>>
>>>> It would require a relink only to fix existing binaries which are broken
>>>> by the use of -fno-plt, which is not an option that has seen general use
>>>> anywhere that I am aware of.
>>>
>>> I don't think that's actually true.  BFD ld has not emitted
>>> R_X86_64_JUMP_SLOT relocations with -z now for quite some time now.
>>> This optimization predates -fno-plt.
>>>
>>
>> Not true with binutils 2.30:
>>
>> [hjl@gnu-bdx-1 include]$ readelf -d /bin/ld | grep NOW
>>  0x0000000000000018 (BIND_NOW)
>>  0x000000006ffffffb (FLAGS_1)            Flags: NOW PIE
>> [hjl@gnu-bdx-1 include]$ readelf -rW /bin/ld | grep JUMP_SLOT
>> 00000000001b0868  0000000100000007 R_X86_64_JUMP_SLOT
>> 0000000000000000 getenv@GLIBC_2.2.5 + 0
>> ...
>
> But binutils 2.28 or some earlier version exhibited different
> behavior, right?

Yes.

-- 
H.J.