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: Can objdump show friendly symbolic function name?


On Thu, 22 Jul 2010, David Daney wrote:

> >   I suppose it should be moderately easy to decode the prologue of each
> > function then to see which GOT $gp refers to.
> 
> Modern GCCs will not generate a fixed function prologue layout, and for leaf
> functions the GP will not necessarily be in $28.  Add in the difference caused
> by -mshared and -mplt, and there can be quite a bit of variability.

 GDB largely relies on the ability to decode function prologues and from 
my experience it has worked pretty well.  I see no reason why other tools 
couldn't follow if need be.

> I think it is still technically feasible, but it could be a rather large piece
> of code.  I would note that this problem is similar to the problem of
> generating a stack trace by using code inspection.  It is possible, but using
> real debugging info is far better.

 You only need to get your hands on $gp here and the ABI pretty much 
constrains the sequences used to be that emitted by .cpload/.cpsetup as 
applicable.  There's little room for variance here as software relies on 
them for various purposes you may have no idea of (which is the point of 
any standardisation).

 Even then, if the prologue scanner fails to see any of the sequences 
permitted, then you'll just get no symbol references as you do today.  I 
do not ask for handling .cplocal -- that's probably too tricky, at least 
for a start, and too much of a corner case (mostly useful for leaf 
functions -- I haven't checked how much, if at all, GCC makes use of it).

  Maciej


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