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

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 18:58:16 PDT 2020


int3 added a comment.

> but would any of this be easier if SyntheticSections were InputSections instead of OutputSections

Maybe... we could make them InputSections and then generate unsigned relocations for each of their entries. There would be some additional overhead (e.g. the `addend` field would be useless) but it would allow us to handle the rebases in one place. One thing I'm not sure about is whether other architectures have an equivalent of `X86_64_RELOC_UNSIGNED` that can be used for this; it looks like arm64 does, but not sure about PPC (not that it really matters).

There are other benefits to having SyntheticSections be InputSections: there would no longer be a need for the `SectionPointerUnion`, and `DSOHandle` could just be an ordinary `Defined` symbol.

I actually can't think of many real downsides... do you have any in mind? That said, the current architecture is not terrible, and I'm inclined to work on implementing more features and pushing the refactoring till later.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87199/new/

https://reviews.llvm.org/D87199



More information about the llvm-commits mailing list