This is an archive of the discontinued LLVM Phabricator instance.

[lld-macho] Make load relaxation work for arm64_32
ClosedPublic

Authored by int3 on Apr 9 2021, 1:47 PM.

Details

Summary

arm64_32 uses 32-bit GOT loads, so we should accept those
instructions in ARM64Common::relaxGotLoad() too.

Diff Detail

Event Timeline

int3 created this revision.Apr 9 2021, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2021, 1:47 PM
int3 requested review of this revision.Apr 9 2021, 1:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2021, 1:47 PM
gkm accepted this revision.Apr 11 2021, 8:04 PM
gkm added a subscriber: gkm.

LGTM

lld/test/MachO/arm64-32-reloc-got-load.s
2

Super nitty: this and the original arm64-reloc-got-load.s have some tabs, and even some whitespace only differences between them.

For that matter, these 16 test files have some tabs:

./x86-64-reloc-got-load.s
./why-load.s
./arm64-relocs.s
./arm64-reloc-pointer-to-got.s
./weak-reference.s
./objc.s
./invalid/bad-got-to-dylib-tlv-reference.s
./invalid/bad-tlv-def.s
./invalid/bad-tlv-opcode.s
./weak-binding.s
./indirect-symtab.s
./tlv-dylib.s
./arm64-32-reloc-got-load.s
./mattrs.ll
./arm64-reloc-got-load.s
./tlv.s
28

The original arm64-reloc-got-load.s had this comment appended to the line: ; literal pool symbol address: _foo

30

The original arm64-reloc-got-load.s had this comment appended to the line: ; literal pool symbol address: _bar

This revision is now accepted and ready to land.Apr 11 2021, 8:04 PM
int3 added inline comments.Apr 11 2021, 8:26 PM
lld/test/MachO/arm64-32-reloc-got-load.s
2
28

unfortunately llvm-objdump doesn't emit those comments for arm64_32

This revision was landed with ongoing or failed builds.Apr 13 2021, 7:44 AM
This revision was automatically updated to reflect the committed changes.