<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Reconsider allowing private GV for comdats"
   href="http://llvm.org/bugs/show_bug.cgi?id=22775">22775</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Reconsider allowing private GV for comdats
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Core LLVM classes
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rafael.espindola@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>