<div dir="ltr">COFF spec is not clear about whether symbols can be unnamed or not, but as far as I tried, at least MSVC accepts that. I replaced all symbols starting with L_ with empty strings using yaml2obj/obj2yaml, and the resulting object file still worked with link.exe.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 17, 2015 at 10:09 AM, Rafael EspĂndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.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 is a work in progress.<br>
<br>
What it does is make all symbols that would otherwise start with a .L<br>
(or L on MachO) unnamed.<br>
<br>
There are two issues to be aware of:<br>
<br>
* Some of these symbols can show up in the symbol table.<br>
* We still want to produce binary identical files when going through<br>
assembly files.<br>
<br>
If the first one is handled, the second one goes away by making sure<br>
we ignore the name of *all* .L symbols: we pick one when writing<br>
assembly, but it never shows up in the final .o.<br>
<br>
In this patch I have handled the first issue only in the ELF writer by<br>
supporting unnamed symbols.<br>
<br>
Can symbols be unnamed on COFF and MachO? If not, I think we could<br>
still do this and let those object writers invent a deterministic name<br>
at the very end, no?<br>
<br>
I tested this locally by doing a bootstrap.<br>
<br>
I tested the memory savings for llvm-mc are quite noticeable. When<br>
assembly a LTO llvm-as, the memory usage goes from 45,952,208 to<br>
39,137,568 bytes.<br>
<br>
Cheers,<br>
Rafael<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>