This is an archive of the discontinued LLVM Phabricator instance.

[llvm-mc][macho][RFC] Enable DwarfFDESymbolsUseAbsDiff on aarch64
Changes PlannedPublic

Authored by int3 on Apr 13 2022, 1:15 PM.

Details

Summary

I am trying to do this to make it easier for LLD to support EH frames
for multiple archs. At present, DwarfFDESymbolsUseAbsDiff (first added
[here][1]) is only enabled for x86 archs. Rather than making LLD support
both abs-diff EH frame relocations as well as regular ones, I'm hoping
we can make MC emit EH frame relocs in the same format across archs.

However, naively toggling the flag gives us an [assertion error][4] when
running MC (and deleting the assertion results in a crash). So I
reverted [the commit that added the assertion][2] and removed some
functionality. This gets me the desired output for aarch64, but causes
[this test][3] to fail instead.

From reading commit #2's message, I suspect reverting it isn't the right
approach. Rafael authored that commit, but he's no longer around;
however the commit does reference r249303 which was also worked on by
@m.ostapenko and a mononymous "andy". I'm not sure who Andy is, so just
adding Maxim for now. Any pointers would be greatly appreciated :)

[1]: https://github.com/llvm/llvm-project/commit/618def651b59bd42c05bbd91d825af2fb2145683
[2]: https://github.com/llvm/llvm-project/commit/06c064824ef29425db785a31fed03821777fbf12
[3]: https://github.com/llvm/llvm-project/blob/main/llvm/test/CodeGen/AArch64/arm64_32.ll
[4]: https://github.com/llvm/llvm-project/blob/2a6669060f3533d144b12d1ec0faafe2de537994/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp#L325

Diff Detail

Event Timeline

int3 created this revision.Apr 13 2022, 1:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 1:15 PM
int3 requested review of this revision.Apr 13 2022, 1:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 1:15 PM
int3 edited the summary of this revision. (Show Details)Apr 13 2022, 1:22 PM

@MaskRay, @thakis -- might you guys know of any good reviewers for MC relocation logic? I'm a bit in over my head here...

@MaskRay, @thakis -- might you guys know of any good reviewers for MC relocation logic? I'm a bit in over my head here...

Either @lhames is or can point you to the appropriate one:)

int3 added a reviewer: lhames.Apr 19 2022, 2:07 PM
int3 planned changes to this revision.Jun 30 2022, 12:51 PM