This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ld gas Fake PLT entries and absolute address


On Mon, Feb 22, 2010 at 12:11 PM, chrima.hercou
<chrima.hercou@laposte.net> wrote:
>
> Hi Gnu community !
>
> I've got some questions dealing with particular uses of GAS and LD :
> I'm working on a code, in assembly X86-64 which must contains absolute
> address of PLT entry. The idea is having something like :
>
> label:
> .long functionCall@PLT
>
> later, i will load this address in a register, for an absolute call.
>
> My problems are :
> * How can i obtained this address ? For now, i compile the code, look at .plt
> section, put the address and recompile it.
> * How can i create artificial PLT entry ? For now, i use a declaration like the
> 'label' one, and put the '--unresolved-symbols=ignore-in-object-files' flag.
>
> So, why this ?
> The aim is having instrumentations in the code that are only activated when a
> LD_PRELOAD is made. Instrumentations's function reside in PLT entries and the
> address for the call (absolute PLT address) resides in particular headers.
> It would be nice if i could compile without having to give a fake shared object
> for having my PLT entries (and it will not resolve the first problem).
>

Are you using Linux? Have you considered LD_AUDIT interface?

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]