This is an archive of the discontinued LLVM Phabricator instance.

[AIX][TLS] Account for local-exec accesses in XCOFFObjectWriter
ClosedPublic

Authored by amyk on Jul 16 2023, 7:28 PM.

Details

Summary

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.

Diff Detail

Event Timeline

amyk created this revision.Jul 16 2023, 7:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2023, 7:28 PM
amyk requested review of this revision.Jul 16 2023, 7:28 PM
llvm/test/CodeGen/PowerPC/aix-tls-le-xcoff-reloc.ll
183

Copy/paste error?

255–256

Missing the interesting 4 bytes of the encoded value.

258–259

Same comment.

261–262

To be consistent, same comment.

264–265

Same comment.

amyk updated this revision to Diff 540999.Jul 17 2023, 6:45 AM

Update aix-tls-le-xcoff-reloc.ll to show the bytes of the encoded value that I originally missed, and also add the correct symbol name that I missed earlier.

amyk marked 5 inline comments as done.Jul 17 2023, 6:45 AM

Code change looks good.
For each test:

  • Noted the symbol table index for the referenced symbols of each R_TLS_LE relocation.
  • Checked that the values encoded "at" the target addresses match the address values of the referenced symbols.

LGTM; thanks!

This revision is now accepted and ready to land.Jul 17 2023, 7:09 AM
amyk edited the summary of this revision. (Show Details)Jul 17 2023, 7:56 AM
This revision was landed with ongoing or failed builds.Jul 17 2023, 10:16 AM
This revision was automatically updated to reflect the committed changes.