[LLVMbugs] [Bug 7399] New: LLVM doesn't properly parse section names (or emit them into .ll files)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 17 10:24:57 PDT 2010


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

           Summary: LLVM doesn't properly parse section names (or emit
                    them into .ll files)
           Product: new-bugs
           Version: 2.7
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: davidterei at gmail.com
                CC: llvmbugs at cs.uiuc.edu


If you have a section name like this:

define cc 10 void @Main_main2_entry( ) nounwind section
".text,\"ax\", at progbits\n\t.subsection 2 #"

Then llvm-as will fail to parse it as it doesn't seem to support escaped
quotes. The error returned when trying to run llvm-as on it is:

llvm-as: /tmp/ghc14264_0/ghc14264_0.ll:49:66: error: expected '{' in function
body
define cc 10 void @Main_main2_entry( ) nounwind section
".text,\"ax\", at progbits\n.subsection 2 #"
                                                                 ^

A second problem is that as well as not support escaped quotes, llvm-as/llc
don't support interpreting '\n' to mean newline. It will instead just put the
two literal characters into the section name in the assembly file.

This is also a problem because Clang produces invalid .ll files. If you get
clang to compile a C function like this to an .ll file:

__attribute__((section(".text,\"ax\", at progbits\n\t.subsection 1 #")))
void foo()
{
}

Then the .ll file produced by Clang is:

define void @food( ) section ".text,\"ax\", at progbits
.subsection 2 #"

Having Clang compile the C function to machine code works fine, its simply a
problem with parsing and printing out section names in .ll files.

Cheers,
David

-- 
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