[PATCH] D110464: [lld-macho][nfc] Added some notes on deliberate differences btw LLD vs LD64

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 24 18:41:13 PDT 2021


oontvoo created this revision.
oontvoo added a reviewer: int3.
Herald added a reviewer: gkm.
Herald added a project: lld-macho.
Herald added a reviewer: lld-macho.
oontvoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For future references and to help with debugging crashes, this could be useful.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110464

Files:
  lld/MachO/notes.txt


Index: lld/MachO/notes.txt
===================================================================
--- /dev/null
+++ lld/MachO/notes.txt
@@ -0,0 +1,18 @@
+This docs is the running list of significant differences in behaviour between LD64 and LLD-MachO.
+
+Symbol resolutions
+  - General resolution rule:
+    + LD64: the "winning" symbols are chosen based on several criteria.
+    + LLD:  metadata from symbols with the same are merged, and the content of
+               the first symbol in the symbol table  with that name is kept.
+  
+  - ObjC symbols from archives (linked with -ObjC flag, which acts similarly to -force_load in both linkers)
+    + LD64:
+      * Duplicate ObjC symbols from the same arhives are fine. It will pick the first one.
+      * Duplicate ObjC symbols from different archives will raise a "duplicate symbol" error.
+    + LLD: Duplicate symbols, regardless of which archives they are from, will raise errors.
+
+  - Handling of personality symbols
+
+
+// FIXME: There's something to say about section alignment. I forgot...


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110464.375005.patch
Type: text/x-patch
Size: 1056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210925/0082f737/attachment.bin>


More information about the llvm-commits mailing list