[PATCH] Dead strip atoms with deadStripAlways attribute even if dead strip is not enabled.

Shankar Kalpathi Easwaran shankarke at gmail.com
Thu Aug 1 20:37:13 PDT 2013



================
Comment at: lib/Core/Resolver.cpp:298-307
@@ -298,2 +297,12 @@
+    }
+  } else {
+    // If dead strip is disabled, all atoms except deadStripAlways are
+    // considered to be live.
+    for (const Atom *atom : _atoms) {
+      if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom))
+        if (defAtom->deadStrip() == DefinedAtom::deadStripAlways)
+          continue;
+      _deadStripRoots.insert(atom);
+    }
   }
 
----------------
I dontn know why you would have a object file that will contain symbols to set it to deadStripAlways. If this is a seperate input file thats being considered through an option, that option should be checked for before calling this part of code.

Doing this by default, and iterating over all the atoms is going to slow down the linking time especially for larger links.




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



More information about the llvm-commits mailing list