Page MenuHomePhabricator

[lld-macho] Support X86_64_RELOC_UNSIGNED
ClosedPublic

Authored by int3 on Fri, May 15, 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.Fri, May 15, 4:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, May 15, 4:27 PM
smeenai accepted this revision.Fri, May 15, 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.Fri, May 15, 5:19 PM
MaskRay accepted this revision.Fri, May 15, 8:08 PM

LGTM.

lld/MachO/Target.h
32

unrelated?

int3 marked an inline comment as done.Fri, May 15, 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.