<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 --- - Bad unwinding information is output on ARM" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D24146&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=qypvY3vmB1njea3_f1phpxQKweGnu9kh0VkajFNDCco&s=4Yej4U5wCHtpzoyZ0wUMXsVYXFxwAZ3yD5RiddVvFG0&e=">24146</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Bad unwinding information is output on ARM
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>ben@curlybracket.co.uk
          </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>Created <span class=""><a href="attachment.cgi?id=14598" name="attach_14598" title="repro.cpp">attachment 14598</a> <a href="attachment.cgi?id=14598&action=edit" title="repro.cpp">[details]</a></span>
repro.cpp

This has been verified with Clang/LLVM 3.6 and libunwind 1.1, vs GCC 4.8.4
which appears to work correctly. For each case mentioned here the environment
variable UNW_ARM_UNWIND_METHOD=4 so that libunwind uses the .ARM. sections.

Clang broken command line:
clang++-3.6 -lunwind -fPIC -mthumb -target armv7a-linux-gnueabihf repro.cpp 

GCC working command line:
g++ -mthumb -fPIC -march=armv7-a repro.cpp -lunwind

As far as I can tell the two above invocations should give similar output for
the two compilers, however, when built with Clang, after unwind PC and LR are
zero, where as when built with GCC they have their correct values, as verified
with GDB. It seems Clang is outputting incorrect unwinding information. Perhaps
meaningless, but the .ARM.extab. and .ARM.exidx. sections are considerably
smaller in the Clang build than the GCC build. 0x18 and 0x30 vs 0x3c and 0x38
bytes respectively.</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>