[llvm-commits] [llvm-mc][patch] Rename local symbols if needed

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Oct 26 10:33:39 PDT 2010


A ping on a patch posted two weeks ago:

Currently llvm-mc will fail to assemble

----------------------------------------------------
       .size bar, . - bar
.Ltmp0:
      .size foo, .Ltmp0 - foo
--------------------------------------------------

With the interesting error message

../test.s:4:1: error: invalid symbol redefinition
.Ltmp0:

The problem is the the dot in the first size statement causes llvm-mc
to create a temporary symbol named ".Ltmp0".

The attached patch renames new local symbols to avoid the conflict.
This particular case can be solved by just printing "." for the
artificial symbol, but that is not always valid (debug generation
creates temporary symbols too).

Unfortunately we cannot delay the name generation as we print assembly
as it is produced/parsed.

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


More information about the llvm-commits mailing list