This is the mail archive of the binutils@sources.redhat.com 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: Correct the type of _PROCEDURE_LINKAGE_TABLE_


Daniel Jacobowitz <drow@false.org> writes:

> > > > > objdump will not dump the PLT as instructions if it starts
> > > > > with an STT_OBJECT symbol.
> > > > 
> > > > Really?  Fix objdump then.  _PROCEDURE_LINKAGE_TABLE_ isn't a function,
> > > > nor are many other symbols in code sections.
> > > 
> > > >From the gABI:
> > > 
> > > STT_OBJECT
> > >                   The symbol is associated with a data object, such as a variable,
> > >                   an array, and so on.
> > > 
> > > STT_FUNC
> > >                   The symbol is associated with a function or other executable
> > >                   code.
> > > 
> > > _PROCEDURE_LINKAGE_TABLE_ in this case is "other executable code", and not a "data
> > > object", so I think it should be STT_FUNC.
> > 
> > Isn't a table an array of sorts?  Perhaps it won't hurt anything to
> > change the type, but who knows?  If you can twist Ian's arm to approve
> > it, then fine!  Otherwise, I'm inclined to be grumpy and reject the
> > patch.
> 
> A mighty messed up array, if you ask me.  OK.  Ian, any comment?

Ummm.

I think I originally made _PROCEDURE_LINKAGE_TABLE_ an STT_OBJECT
symbol because that is what the Solaris linker did.  Your patch would
make it into an STT_FUNC symbol on most targets, including Solaris.

I think it would clearly be incorrect to make
_PROCEDURE_LINKAGE_TABLE_ an STT_FUNC symbol in a .o file, since that
could cause various sorts of bad linkage.  But of course
_PROCEDURE_LINKAGE_TABLE_ doesn't appear in .o files.

I suppose that when I think of _PROCEDURE_LINKAGE_TABLE_, I think of
it as naming a data object: the procedure linkage table, in fact.
It's true that there is often code at that address.  But it's not
really a function in any sense.  Most of the entries in the PLT come
with their own STT_FUNC symbols.  So at least in most cases we are
only talking about the bit of code which comes at the start of the
PLT.

My inclination is to agree with Alan, and to say that we should fix
objdump.  But I don't feel very strongly about it.

Ian


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