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


> Message du 22/02/10 22:46
> De : "chrima.hercou" 
> A : "H.J. Lu" 
> Copie à : 
> Objet : Re: ld gas Fake PLT entries and absolute address
>
> 
> 
> 
> > Message du 22/02/10 22:30
> > De : "H.J. Lu" 
> > A : "chrima.hercou" 
> > Copie à : binutils@sourceware.org
> > Objet : Re: ld gas Fake PLT entries and absolute address
> >
> > 
> > On Mon, Feb 22, 2010 at 12:11 PM, chrima.hercou
> > 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.
> 
Yes, I'm on a linux X86-64, but the aim is to have something more "portable", that's why I wanted to rely on the toolchains (from compilation of different part of the projet to the dynamic linking).
And for a more general knowledge about thoses tools, i think there are good questions, especialy when you learn about dynamic linking (could be cool for experiment).
Thanks for the hint about LD_AUDIT ;)

Une messagerie gratuite, garantie à vie et des services en plus, Ãa vous tente ?
Je crÃe ma boÃte mail www.laposte.net


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