[LLVMbugs] [Bug 3750] New: FreeBSD's ld-elf. so miscompiles when array is marked as static

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sat Mar 7 07:19:05 PST 2009


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

           Summary: FreeBSD's ld-elf.so miscompiles when array is marked as
                    static
           Product: clang
           Version: unspecified
          Platform: PC
               URL: http://svn.freebsd.org/viewvc/base/head/libexec/rtld-
                    elf/rtld.c?view=markup
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: ed at 80386.nl
                CC: llvmbugs at cs.uiuc.edu
            Blocks: 3696


Created an attachment (id=2678)
 --> (http://llvm.org/bugs/attachment.cgi?id=2678)
LLVM IR of rtld.c

We're having this issue with Clang, which we cannot reduce to a simple test
case. This is why we're just filing a bug report and hoping you folks know the
answer or can tell us how to track down the cause of the issue. Notice we
slightly changed the code to use __attribute__((__weak__)) instead of #pragma
weak (see 3679).

When rtld is compiled with Clang using -O or -O2, applications that use the
dynamic linker will die on startup:

ld-elf.so.1: assert failed: rtld.c:1199

This can be solved by compiling rtld with -O0 or marking the `exports' array in
the file 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.



More information about the llvm-bugs mailing list