OSDN Git Service

[lld-macho] Implement GOT_LOAD relaxation
authorJez Ng <jezng@fb.com>
Thu, 27 Aug 2020 22:59:45 +0000 (15:59 -0700)
committerJez Ng <jezng@fb.com>
Fri, 28 Aug 2020 00:44:17 +0000 (17:44 -0700)
commit7083363c05abe4afd8af8d6bacdd79c9cf10585b
tree4729c9ac272de5d92fb199704952c6b83082a8a8
parent2a38dba7dd4d3360908e93c326fbef6a7465346e
[lld-macho] Implement GOT_LOAD relaxation

We can have GOT_LOAD relocations that reference `__dso_handle`.
However, our binding opcode encoder doesn't support binding to the DSOHandle
symbol. Instead of adding support for that, I decided it would be cleaner to
implement GOT_LOAD relaxation since `__dso_handle`'s location is always
statically known.

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D86641
lld/MachO/Arch/X86_64.cpp
lld/test/MachO/local-got.s
lld/test/MachO/x86-64-reloc-got-load.s [new file with mode: 0644]