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

Reply via email to