[LLVMbugs] [Bug 8596] New: MC Temporary Symbol Name Clash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 12 14:55:03 PST 2010


http://llvm.org/bugs/show_bug.cgi?id=8596

           Summary: MC Temporary Symbol Name Clash
           Product: tools
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: llc
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: pdox at google.com
                CC: llvmbugs at cs.uiuc.edu


Both CodeGen and MCAsmParser use MCContext::CreateTempSymbol() to create a
unique temporary symbol. The symbol is made unique by incrementing a UniqueID
counter.

But if the output of CodeGen is first emitted to a .s file, and then afterwards
assembled by llvm-mc, the UniqueID counter is not preserved, so naming clashes
can occur.

On X86-64 Linux ELF, you can demonstrate the problem using conflict.ll:

llc -filetype=asm conflict.ll -o conflict.s
llvm-mc -filetype=obj conflict.s -o conflict.o

The error:

conflict.s:23:1: error: invalid symbol redefinition
.Ltmp0:
^

Reason:
In llvm-mc, the "." expression is evaluated by creating a temporary symbol, but
the temporary name .Ltmp0 is already taken, since it was generated during the
call to llc.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list