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]

TLS relocations in PPC


I'm not sure if this is the right place to ask. I'm trying to figure out what all the different PPC relocations do; a good number of them are documented, but GAS supports a bunch that I can't find in the spec or anywhere else. One of them is @tls, which has the confusing side-effect of rewriting the encoding of the field it's applied to

For example, if I assemble "li 0, foo@l+8", it encodes as 0x38000008 with an R_PPC_ADDR16_LO reloc on foo with an addend of 8. I don't really understand why it encodes the 8 in the instruction if PPC uses RELA relocations and it's just going to be overwritten later (i.e. 0x38000000 should work the same I would think), but I've been ignoring that. However, "li 0, foo@tls+8" encodes as 0x38000002. Where did the 2 come from? It seems to encode the @tls field as a 2 no matter what, which makes me think maybe the encoding of the field is important even if it's going to be rewritten by a relocation later. Does it mean anything, or is it just a side-effect of some other processing?

As a side-note, are the TLS relocations documented somewhere? Almost all of the relocs I haven't been able to find in the spec or elsewhere are TLS-related, it feels like there must be some document somewhere that lists them all and what they mean that I'm just missing

Thanks a lot

Attachment: pgp00000.pgp
Description: PGP signature


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