[PATCH] D75382: [lld] Initial commit for new Mach-O backend

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 12:29:28 PST 2020


int3 marked an inline comment as done.
int3 added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:37
+// a Mach-O relocation has a bit indicating whether it refers a symbol or a
+// location within the same section. R_SCATTERED is that bit.
+//
----------------
pcc wrote:
> I don't believe that this is true in general. In the case where R_SCATTERED is false, bit 27 of r_word1 (the `extern` bit) indicates whether the relocation refers to a symbol or a section address. You can see this by grepping for `rExtern` in the existing lld, and seeing how relocations with/without the bit are handled (e.g. http://llvm-cs.pcc.me.uk/tools/lld/lib/ReaderWriter/MachO/ArchHandler_arm64.cpp#434 ).
This was originally written by @ruiu, but I *think* what this means is that R_SCATTERED determines whether the relocation is referring to something within the same section, and not whether it's referring to a symbol or a section. I'll rephrase things...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75382





More information about the llvm-commits mailing list