This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Support X86_64_RELOC_UNSIGNED
ClosedPublic

Authored by int3 on May 15 2020, 4:27 PM.

Details

Summary

Note that it's only used for non-pc-relative contexts.

Depends on D79926.

Diff Detail

Event Timeline

int3 created this revision.May 15 2020, 4:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2020, 4:27 PM
smeenai accepted this revision.May 15 2020, 5:19 PM

ld64 emits an entry in the rebase table so that the relocation can be adjusted for whatever the final load address ends up being. (I'm assuming it does this for all non-pcrel relocations.) Certainly not something we need to support in this diff, but we should add a TODO.

LGTM.

lld/test/MachO/x86-64-reloc-unsigned.s
7

Ah, it's annoying that endianness means we can't do the usual nice arithmetic checks here :/

This revision is now accepted and ready to land.May 15 2020, 5:19 PM
MaskRay accepted this revision.May 15 2020, 8:08 PM

LGTM.

lld/MachO/Target.h
32

unrelated?

int3 marked an inline comment as done.May 15 2020, 8:59 PM
int3 added inline comments.
lld/MachO/Target.h
32

kind of? I thought a linebreak there made sense because the next two methods are specifically dealing with manipulating relocations

This revision was automatically updated to reflect the committed changes.