This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Properly test subtractor relocations & fix their attributes
ClosedPublic

Authored by int3 on Feb 19 2021, 8:39 AM.

Details

Summary

llvm-mc doesn't generate any relocations for subtractions
between local symbols -- they must be global -- so the previous test
wasn't actually testing any relocation logic. I've fixed that and
extended the test to cover r_length=3 relocations as well as both x86_64
and arm64.

Diff Detail

Event Timeline

int3 created this revision.Feb 19 2021, 8:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2021, 8:39 AM
int3 requested review of this revision.Feb 19 2021, 8:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2021, 8:39 AM
int3 retitled this revision from [lld-macho] Fix and properly test subtractor relocations to [lld-macho] Properly test subtractor relocations & fix their attributes.Feb 19 2021, 4:34 PM
smeenai accepted this revision.Feb 26 2021, 4:20 PM
smeenai added a subscriber: smeenai.

LGTM

lld/test/MachO/reloc-subtractor.s
16

Little endian makes this so confusing :(

This revision is now accepted and ready to land.Feb 26 2021, 4:20 PM
This revision was landed with ongoing or failed builds.Feb 27 2021, 9:32 AM
This revision was automatically updated to reflect the committed changes.
lld/test/MachO/reloc-subtractor.s