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

           Summary: Global ctor/dtor priorities not codegened correctly
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=3718)
 --> (http://llvm.org/bugs/attachment.cgi?id=3718)
failing testcase

The attached gcc testcase fails:

$ llvm-g++ -o initp1 initp1.C
$ ./initp1 
Aborted

That's because the constructors are being output in the wrong
order in the ctors section.  EmitXXStructorList in ELFWriter.cpp
should output the ctors in decreasing numerical order of priority.
Right now it doesn't order them at all.

Interestingly, another solution is to not output the ctors
section at all!  This only works for ctors/dtors generated
by gcc: it seems they use magic names that are recognized
by collect2.  So it would be enough for llvm-gcc to not add
ctors to llvm.global_ctors at all, and just mark them as used.


-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to