<div dir="ltr">On Thu, Aug 1, 2013 at 8:37 PM, Shankar Kalpathi Easwaran <span dir="ltr"><<a href="mailto:shankarke@gmail.com" target="_blank">shankarke@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
================<br>
Comment at: lib/Core/Resolver.cpp:298-307<br>
@@ -298,2 +297,12 @@<br>
<div class="im">+    }<br>
+  } else {<br>
+    // If dead strip is disabled, all atoms except deadStripAlways are<br>
+    // considered to be live.<br>
+    for (const Atom *atom : _atoms) {<br>
+      if (const DefinedAtom *defAtom = dyn_cast<DefinedAtom>(atom))<br>
+        if (defAtom->deadStrip() == DefinedAtom::deadStripAlways)<br>
+          continue;<br>
+      _deadStripRoots.insert(atom);<br>
+    }<br>
   }<br>
<br>
</div>----------------<br>
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.<br>

</blockquote><div><br></div><div>I don't understand the second sentence. Can you elaborate a bit?</div><div><br></div><div>The use case I expected is for Windows. In Windows, the symbol __BaseImage is a linker-generated symbol. That contains 4-byte address, but no object file defines it. The linker is expected to create it internally and use it if there's a reference to the symbol. We don't want include the symbol value to the executable, but do it only when the symbol is actually used. I thought that the dead stripping naturally fit for that purpose.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Doing this by default, and iterating over all the atoms is going to slow down the linking time especially for larger links.<br></blockquote><div><br></div><div>That may be convincing. Then I guess my question is, what is deadStripAlways for?</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<br>
<a href="http://llvm-reviews.chandlerc.com/D1267" target="_blank">http://llvm-reviews.chandlerc.com/D1267</a><br>
</blockquote></div><br></div></div>