This is the mail archive of the 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: ppc32/objdump : retrieving the symbol's name behind the GOT offset ?

On Sat, Jan 11, 2014 at 12:25 AM, Alan Modra <> wrote:
> On Fri, Jan 10, 2014 at 03:08:53PM -0800, Cary Coutant wrote:
>> > When it's related to the access to an object via the GOT,
>> > objdump/ppc32 produces such disassembled code :
>> >
>> >     lwz     r9,-32764(r30)
>> >
>> > Is there any mean (with objdump, or any other tool) for quickly
>> > retrieving the corresponding real symbol's name of the targeted object
>> > (local or global) ?
>> You'll need to scan the dynamic relocations for the relocation that
>> applies to that particular GOT entry. That relocation will give you
>> the symbol table index (in .dynsym) of the corresponding symbol.
> Yeah, that's what I do by hand.  It's particularly messy with
> -mminimal-toc code (ie. two levels of GOT).  In that case r30 isn't
> pointing at _GLOBAL_OFFSET_TABLE_ so it's not a matter of simply
> looking at _GLOBAL_OFFSET_TABLE_ - 32764.  You need to first find
> the r30 value..

Gasp, tricky indeed... Would -mminimal-toc be the only pitfall of its kind ?


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