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: arm/thumb: problems with function pointers


On Wed, 2002-01-16 at 18:59, Phil Blundell wrote:
> On Wed, 2002-01-16 at 16:37, Adrian von Bidder wrote:
> > My bet is that what was done to be R_ARM_ABS32 in elf32-arm.h needs to
> > be done to R_ARM_GOT32 relocations, too. 
> 
> Mmm, yeah, probably.  Well, try this.

The fix works if the symbol in question is a global symbol, not if it's
a local symbol.

So, we now have special handling in R_ARM_ABS32 and two cases of
R_ARM_GOT32. It makes me wonder if we are not just fighting symptoms of
an error further down - shouldn't the relocation entries be generated
with the lsb set in the first place, instead of setting the bit only on
final link, as it appears is what we do now?

the output of readelf for the .rel.text section has 'symbol values' for
thumb symbols without the lsb set - isn't that the place where it should
already be set? Q: who generates .rel.text section in object files?

What I mean: readelf says
Relocation section '.rel.text' at offset ...:
  Offset    Info  Type          Symbol's Value Symbol's Name
  00000014  0071a R_ARM_GOT32         00000004 callee  

Symbol table '.symtab' contains 10 entries:
      Num:    Value  Size Type    Bind   Vis      Ndx Name
     7: 00000004     4 THUMB_FUNC GLOBAL DEFAULT    1 callee

(similar for LOCAL symbol callee). Shouldn't 'Symbol's Value' in
.rel.texst be 0005 and not 004 right from the start (or do I
misunderstand what the value means?)

greets from Zürich
-- vbi


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