[PATCH] D58378: [PowerPC]Leverage the addend in the TOC relocation to do the address calculation
qshanz via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 2 05:14:38 PST 2020
steven.zhang added a comment.
I get the reason about 0x8000 now.
#ha(value) Denotes the high adjusted value: bits 16 - 63 of the indicated value, compensating
for #lo() being treated as a signed number. That is:
#ha(x) = (x + 0x8000) >> 16
The TOC region commonly includes data items within the .got, .toc, .sdata, and .sbss sections. In the medium
code model, they can be addressed with 32-bit signed offsets from the TOC pointer register. The TOC pointer
register typically points to the beginning of the .got section + 0x8000, which permits a 2 GB TOC with the
medium and large code models.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58378/new/
https://reviews.llvm.org/D58378
More information about the llvm-commits
mailing list