<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 --- - .cfi_sections directives should go before CFI generation start"
   href="https://llvm.org/bugs/show_bug.cgi?id=29017">29017</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>.cfi_sections directives should go before CFI generation start
          </td>
        </tr>

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

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

        <tr>
          <th>Reporter</th>
          <td>artemiyv@acm.org
          </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>Currently, the DwarfCFIException class writes the sections that the CFI emits
(via a .cfi_sections directive) within its endModule() method, after all the
other CFI info has already been output. This renders the resulting .s files
impossible for gnu as to process, since by the rules gnu as uses for the .cfi*
directives the last .cfi_sections directive must precede the first
.cfi_startproc directive (see 7.10.1 @
<a href="https://sourceware.org/binutils/docs/as/CFI-directives.html">https://sourceware.org/binutils/docs/as/CFI-directives.html</a>). This rule has
been enforced in gas since Feb 2016 (commit
bd5608dcc6a76876db06b1af1852252a4282aa2f), after the 2.26 release, and I've
been able to reproduce it for aarch64 and sparc, like this:

<span class="quote">> cd binutils-build
> ../binutils-x86/configure --target=aarch64-linux && make
> cd ../t
> cat t.c</span >
int main()
{
}
<span class="quote">> ../clang-build/bin/clang 1.c -S -O0 -ggdb -target aarch64
> ../binutils-build/gas/as-new 1.s</span >
t.s: Assembler messages:
t.s:142: Error: inconsistent uses of .cfi_sections

This problem has also been reported at
<a href="http://lists.llvm.org/pipermail/llvm-dev/2016-August/103519.html">http://lists.llvm.org/pipermail/llvm-dev/2016-August/103519.html</a>.</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>