This is an archive of the discontinued LLVM Phabricator instance.

[ELF][AArch64] Write addends for TLSDESC relocations with -z rel
ClosedPublic

Authored by arichardson on Apr 15 2021, 4:16 AM.

Details

Summary

Since D100490 this case is diagnosed for -z rel. This commit implements
R_AARCH64_TLSDESC cases for AArch64::getImplicitAddend() and
AArch64::relocate(). However, there are probably further relocation types
that need to be handled for full support of -z rel.

Fixes https://bugs.llvm.org/show_bug.cgi?id=47009

Depends on D100490

Diff Detail

Event Timeline

arichardson created this revision.Apr 15 2021, 4:16 AM
arichardson requested review of this revision.Apr 15 2021, 4:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2021, 4:16 AM
arichardson added a comment.EditedApr 15 2021, 5:41 AM

Breaks lld/test/ELF/x86-64-tlsdesc-gd.s, will investigate.

Fix the failing amd64 test

Rebase on top of D100489

  • fix doc comment
MaskRay added inline comments.Apr 30 2021, 2:41 PM
lld/test/ELF/aarch64-tlsdesc-zrel.s
20

You can make --apply-dynamic-relocs and --no--apply-dynamic-relocs share prefixes for Relocations.

61

Delete comment which doesn't add any value

62

Just delete .type
.size can be deleted as well.

Technically this should be @tls_object, but @object or absence is fine for assemblers.

rebase and shrink test case

arichardson marked 3 inline comments as done.Jul 2 2021, 6:27 AM
MaskRay accepted this revision.Jul 2 2021, 8:21 PM

LGTM.

lld/test/ELF/aarch64-tlsdesc-zrel.s
5

aarch64-pc-linux => aarch64

This revision is now accepted and ready to land.Jul 2 2021, 8:21 PM
This revision was landed with ongoing or failed builds.Jul 9 2021, 2:43 AM
This revision was automatically updated to reflect the committed changes.
arichardson marked an inline comment as done.