This is an archive of the discontinued LLVM Phabricator instance.

[llvm][ELF][AArch64] Handle R_AARCH64_PLT32 relocation
ClosedPublic

Authored by leonardchan on Jun 8 2020, 7:35 PM.

Details

Summary

This patch allows for usage of the @PLT modifier in AArch64 assembly which lowers to an R_AARCH64_PLT32 relocation. See D81184 for handling this relocation in lld.

Diff Detail

Event Timeline

leonardchan created this revision.Jun 8 2020, 7:35 PM
MaskRay added inline comments.Jun 8 2020, 11:08 PM
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
402

Reusing PREL32 seems wrong.

llvm/test/MC/AArch64/elf-reloc-plt32.s
2

Just use -triple=aarch64. You are testing a generic ELF behavior. Don't append Linux or Fuchsia.

9

This line is redundant

10

Replace 4 with {{.*}}

11

Better adding a CHECK-NEXT: }

leonardchan marked 6 inline comments as done.
leonardchan added inline comments.
llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
402

Split into another case. From what I could tell, it should be nearly the same except the upper bound is 2^31.

MaskRay accepted this revision.Jun 9 2020, 2:45 PM

Looks great! But you'll need thumb-ups from Peter(s)

llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
406

(& 0xffffffffU) seems to be redundant.

llvm/test/MC/AArch64/elf-reloc-plt32.s
10

Indent by 2 spaces

This revision is now accepted and ready to land.Jun 9 2020, 2:45 PM
psmith accepted this revision.Jun 10 2020, 6:12 AM

That looks good to me too. Thanks for the updates.

This revision was automatically updated to reflect the committed changes.
leonardchan marked 2 inline comments as done.