This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Support X86_64_RELOC_GOT
ClosedPublic

Authored by int3 on May 29 2020, 9:20 PM.

Details

Summary

As far as I can tell, it's identical to _GOT_LOAD. llvm-mc has the following
comment explaining why _GOT exists:

// x86_64 distinguishes movq foo@GOTPCREL so that the linker can
// rewrite the movq to an leaq at link time if the symbol ends up in
// the same linkage unit.

Depends on D80855.

Diff Detail

Event Timeline

int3 created this revision.May 29 2020, 9:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 29 2020, 9:20 PM
MaskRay accepted this revision.May 30 2020, 9:34 PM

IIUC, X86_64_RELOC_GOT is the non-relaxable form of X86_64_RELOC_GOT_LOAD. We don't relax X86_64_RELOC_GOT_LOAD currently, so the two should have same processing now.

This revision is now accepted and ready to land.May 30 2020, 9:34 PM
int3 added a comment.Jun 2 2020, 3:32 PM

@MaskRay yup that's my understanding too

We should add a TODO to handle linker relaxation.

smeenai accepted this revision.Jun 9 2020, 5:54 PM
int3 updated this revision to Diff 270605.Jun 13 2020, 11:24 PM

add TODO

MaskRay accepted this revision.Jun 14 2020, 11:50 PM
This revision was automatically updated to reflect the committed changes.