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

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 2 12:03:44 PST 2020


pcc added inline comments.


================
Comment at: lld/MachO/InputFiles.cpp:27
+// symbol with N_ALT_ENTRY attribute does not start a new subsection and can
+// point to a middle of a subsection. In this file, we split sections into
+// multiple subsections by scanning a symbol table.
----------------
Since this isn't implemented yet, maybe this part of the comment should be omitted?


================
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.
+//
----------------
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 ).


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