crazy idea: Make all temporary symbols unnamed

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Jun 17 10:09:41 PDT 2015


The attached patch is a work in progress.

What it does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.

There are two issues to be aware of:

* Some of these symbols can show up in the symbol table.
* We still want to produce binary identical files when going through
assembly files.

If the first one is handled, the second one goes away by making sure
we ignore the name of *all* .L symbols: we pick one when writing
assembly, but it never shows up in the final .o.

In this patch I have handled the first issue only in the ELF writer by
supporting unnamed symbols.

Can symbols be unnamed on COFF and MachO? If not, I think we could
still do this and let those object writers invent a deterministic name
at the very end, no?

I tested this locally by doing a bootstrap.

I tested the memory savings for llvm-mc are quite noticeable. When
assembly a LTO llvm-as, the memory usage goes from 45,952,208 to
39,137,568 bytes.

Cheers,
Rafael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: t.patch
Type: text/x-patch
Size: 4783 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150617/c0d19e21/attachment.bin>


More information about the llvm-commits mailing list