<div>Style cleanup:</div><div><br></div><div><div>+  for (std::vector<std::string>::iterator i = options::pass_through.begin(),</div><div>+                                          e = options::pass_through.end();</div>

<div>+       i != e;</div><div>+       ++i) {</div></div><div><br></div><div>The i != e; and ++i can be on one line</div><div><br></div><div><div>+    std::string& item = *i;</div></div><div><br></div><div>Space before &, not after</div>

<div><br></div><div><div>+      if (add_input_library (item_p + 2) != LDPS_OK) {</div></div><div><br></div><div>Extra space after function name before paren.</div><div><br></div><div><div>+      if (add_input_file (item_p) != LDPS_OK) {</div>

</div><div><br></div><div>Extra space again!</div><div><br></div><div>Please fix those and commit.</div><div><br></div><div>This sure is a strange problem. The linker asks us what symbols the IR files use, we tell it the wrong list (lacking symbols we will use) because we can't produce the right one until after we have all the information about all native symbols and all the IR files. The linker may have already discarded a symbol as unused, only to have it come back to life after add_input_file. Would it make sense to hard-code the plugin to tell gold to search in libc and libgcc for any symbols that simplify-libcalls or the backend may have added? That might not work so well for compiler-rt users. Would it make sense to have gold iterate on the list of symbols? They probably wouldn't like that at all, it would be the same as ignoring the order of libraries and .o files on the command line. Maybe we could conservatively include every libc/libgcc function our optimizers might add? It'd be a pain to maintain.</div>

<meta http-equiv="content-type" content="text/html; charset=utf-8"><div><br></div><div>Anyhow, I'm not going to ask you to pursue that (unless you really want to). Your fix solves the problem without introducing a big mess for any of the pieces.</div>

<div><br></div><div>Could anyone comment on what Apple's LTO link does about this?</div><div><br></div><div>Nick</div><div><br><div class="gmail_quote">On 18 June 2010 07:21, Rafael Espindola <span dir="ltr"><<a href="mailto:espindola@google.com">espindola@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The attached patch adds a pass-through option to the plugin. The use<br>
for this option is to ask the linker to take another look into some<br>
library or object. The case when one might want to do this is when<br>
codegen introduces a new undefined reference. The canonical example is<br>
libgcc.<br>
<br>
Cheers,<br>
<font color="#888888">--<br>
Rafael Ávila de Espíndola<br>
</font></blockquote></div><br></div>