<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Clang++ generates unaligned stub symbol holding a pointer"
   href="https://bugs.llvm.org/show_bug.cgi?id=36885">36885</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang++ generates unaligned stub symbol holding a pointer
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>LLVM Codegen
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>rahulchaudhry@chromium.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Reduced testcase:

---------------- test.cpp ----------------
char str[]= "..";

int foo(void) {
        return 0;
}

class bar {
};

int main(void) {
        try {
                return foo();
        } catch(bar &e) {
                return 1;
        }
}
------------------------------------------

$ clang++ -fPIE -S test.cpp
# relevant sections from test.s:
        .type   str,@object             # @str
        .data
        .globl  str
str:
        .asciz  ".."
        .size   str, 3

        .type   _ZTS3bar,@object        # @_ZTS3bar
        .section        .rodata._ZTS3bar,"aG",@progbits,_ZTS3bar,comdat
        .weak   _ZTS3bar
_ZTS3bar:
        .asciz  "3bar"
        .size   _ZTS3bar, 5

        .type   _ZTI3bar,@object        # @_ZTI3bar
        .section        .data.rel.ro._ZTI3bar,"aGw",@progbits,_ZTI3bar,comdat
        .weak   _ZTI3bar
        .p2align        3
_ZTI3bar:
        .quad   _ZTVN10__cxxabiv117__class_type_infoE+16
        .quad   _ZTS3bar
        .size   _ZTI3bar, 16

        .data
.L_ZTI3bar.DW.stub:
        .quad   _ZTI3bar

This last symbol, '.L_ZTI3bar.DW.stub' ends up directly following 'str' in
.data section (at offset 3).
Note that there is no '.p2align' directive for this symbol.
This is a stub symbol used in <main> for indirect reference to the typeinfo for
class bar.</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>