[PATCH] D87199: [lld-macho] Implement support for PIC

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 5 19:06:01 PDT 2020


int3 created this revision.
int3 added a reviewer: lld-macho.
Herald added subscribers: llvm-commits, mgrang.
Herald added a project: LLVM.
int3 requested review of this revision.

- Implement rebase opcodes. Rebase opcodes tell dyld where absolute addresses have been encoded in the binary. If the binary is not loaded at its preferred address, dyld has to rebase these addresses by adding an offset to them.
- Support `-pie` and use it to test rebase opcodes.

This is necessary for absolute address references in dylibs, bundles etc
to work.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87199

Files:
  lld/MachO/Arch/X86_64.cpp
  lld/MachO/Config.h
  lld/MachO/Driver.cpp
  lld/MachO/SyntheticSections.cpp
  lld/MachO/SyntheticSections.h
  lld/MachO/Writer.cpp
  lld/test/MachO/dylink-lazy.s
  lld/test/MachO/local-got.s
  lld/test/MachO/x86-64-reloc-unsigned.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D87199.290118.patch
Type: text/x-patch
Size: 20050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200906/73b2b950/attachment.bin>


More information about the llvm-commits mailing list