[PATCH] D72027: [XCOFF][AIX] Support basic relocation type on AIX
David Tenty via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 23 08:19:48 PST 2020
daltenty added inline comments.
================
Comment at: llvm/test/CodeGen/PowerPC/aix-xcoff-reloc.ll:85
+; RELOC-NEXT: Symbol: globalA (18)
+; RELOC-NEXT: IsSigned: No
+; RELOC-NEXT: FixupBitValue: 0
----------------
jasonliu wrote:
> daltenty wrote:
> > For the R_TOC relocation, shouldn't this be signed as this is a displacement?
> The relocation reference for toc entry should always be unsigned, because it is relative to the TOC anchor, and TOC entry has to come after TOC anchor.
This does not appear to be the case generally. While we may generate them at a strictly positive offset in the object file
(possible more than can fit in the available displacement), the linker will combine and reorder them into a valid order.
Thus if there are more than 8192 TOC entries (in 32-bit mode), the linker will place TC entries above the anchor and generate the appropriately negatively signed displacement.
XLC also thus appears to generate these relocations as signed.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D72027/new/
https://reviews.llvm.org/D72027
More information about the llvm-commits
mailing list