<html>
    <head>
      <base href="https://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 --- - pragma weak doesn't work if has more than 1 alias"
   href="https://llvm.org/bugs/show_bug.cgi?id=28611">28611</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>pragma weak doesn't work if has more than 1 alias
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>qshanz@cn.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre><span class="quote">> cat a.c</span >
#pragma weak a = bad
#pragma weak b = bad
#pragma weak c = bad
void bad(int *info ) { *info = 0 ; }

<span class="quote">> clang a.c -c
> readelf -sW a.o</span >
   Num:    Value          Size Type    Bind   Vis      Ndx Name
     0: 0000000000000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS a.c
     2: 0000000000000000    32 FUNC    WEAK   DEFAULT    2 a
     3: 0000000000000000    32 FUNC    GLOBAL DEFAULT    2 bad

Note that, the symbol b and c are missing.

This is gcc behavior:
     8: 0000000000000000    52 FUNC    GLOBAL DEFAULT    1 bad
     9: 0000000000000000    52 FUNC    WEAK   DEFAULT    1 a
    10: 0000000000000000    52 FUNC    WEAK   DEFAULT    1 b
    11: 0000000000000000    52 FUNC    WEAK   DEFAULT    1 c

<span class="quote">> clang -v</span >
clang version 3.9.0 (trunk 264998) (llvm/trunk 264997)
Target: powerpc64le-unknown-linux-gnu
Thread model: posix</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>