[PATCH] [PECOFF] Support a new type of weak symbol.

kledzik at apple.com kledzik at apple.com
Thu Mar 6 16:47:49 PST 2014



================
Comment at: lib/Core/SymbolTable.cpp:129-140
@@ +128,14 @@
+
+  // Check if they are merged by szie. If their sizes are equal, merge as if
+  // they are weak symbols.
+  if (mf == DefinedAtom::mergeSameSize) {
+    if (first->size() != second->size())
+      return MCR_Error;
+    mf = DefinedAtom::mergeAsWeak;
+  }
+  if (ms == DefinedAtom::mergeSameSize) {
+    if (first->size() != second->size())
+      return MCR_Error;
+    ms = DefinedAtom::mergeAsWeak;
+  }
+
----------------
Just grow the mergeCases table to be 5x5 instead of 4x4.

================
Comment at: include/lld/Core/DefinedAtom.h:102
@@ -102,1 +101,3 @@
+    mergeByContent,         // Merge with other constants with same content
+    mergeSameSize,          // Another atom with different size is error
   };
----------------
Maybe mergeSameNameAndSize. 


http://llvm-reviews.chandlerc.com/D2996



More information about the llvm-commits mailing list