[AIX][TLS] Account for local-exec accesses in XCOFFObjectWriter
authorAmy Kwan <amy.kwan1@ibm.com>
Mon, 17 Jul 2023 14:57:34 +0000 (09:57 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Mon, 17 Jul 2023 17:15:44 +0000 (12:15 -0500)
commit8e0e442c1d10fdb2acbac75a2c144b19b5d8e20f
tree330d75fa7fe07ddcb0b66fd1fde55ec0ea794a8d
parentb61fac52228c11df01f7fcd60f5e54a38318f21e
[AIX][TLS] Account for local-exec accesses in XCOFFObjectWriter

This is a follow up to D149722 and aims to address https://github.com/llvm/llvm-project/issues/63885.
Local-exec accesses were not previously accounted for in XCOFFObjectWriter.
Specifically, the R_TLS_LE relocation was not previously handled, which lead to
the incorrect value being written for the relocation target.

Within this patch, the value being written is set to the symbol's virtual
address and extra relocation tests are added.

Differential Revision: https://reviews.llvm.org/D155415
llvm/lib/MC/XCOFFObjectWriter.cpp
llvm/test/CodeGen/PowerPC/aix-tls-le-xcoff-reloc-large.ll
llvm/test/CodeGen/PowerPC/aix-tls-le-xcoff-reloc-large32.ll
llvm/test/CodeGen/PowerPC/aix-tls-le-xcoff-reloc.ll
llvm/test/CodeGen/PowerPC/aix-tls-le-xcoff-reloc32.ll