[LLVMbugs] [Bug 22775] New: Reconsider allowing private GV for comdats

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 3 12:58:58 PST 2015


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

            Bug ID: 22775
           Summary: Reconsider allowing private GV for comdats
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

We currently reject

$g = comdat any
@g = private global i32 42, comdat

and accept

$g = comdat any
@g = internal global i32 42, comdat

It looks like we should reject both for ELF but accept both for COFF.

One ELF the issue is that only the signature name is used. So if two files are
linked and each has a COMDAT with symbol foo, one is dropped. Since internal
and private can get renamed, it is not sound to do this.

For COFF it looks like the linker will keep both if "foo" is an internal
symbol. This means that it will correctly handle accidental collisions.

For internal in COFF this already works.

For private we have to teach CodeGen to produce a symbol for the GV if it is
used as a comdat signature.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150303/791e5182/attachment.html>


More information about the llvm-bugs mailing list