<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 --- - ARM integrated assembler fails to parse the symbol variants it generates"
   href="http://llvm.org/bugs/show_bug.cgi?id=18080">18080</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ARM integrated assembler fails to parse the symbol variants it generates
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </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>llc
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>dpeixott@codeaurora.org
          </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>The integrated assembler for ARM fails to parse the assembly it generates for
symbol variants (e.g. foo(plt)). This is a problem for even a simple hello
world in c++

  #include <iostream>
  void foo() {
    std::cout << "Hi";
  }

because of the static initializer used for global iostream objects:
<a href="http://llvm.org/docs/FAQ.html#what-is-this-llvm-global-ctors-and-global-i-a-stuff-that-happens-when-i-include-iostream">http://llvm.org/docs/FAQ.html#what-is-this-llvm-global-ctors-and-global-i-a-stuff-that-happens-when-i-include-iostream</a>

The assembly that clang generates includes a section like this:

  .section        .init_array,"aw",%init_array
  .align  2
  .long   _GLOBAL__I_a(target1)

but when we try to parse this assembly, we get an error:

t.s:91:20: error: unexpected token in directive
        .long   _GLOBAL__I_a(target1)
                            ^
The problem is that the asm parser only has support for symbol variants that
are separated from the symbol by an '@' (e.g. foo@plt). The arm assembly (at
least on linux) uses parens to separate the symbol from its variant (e.g.
target1 in this case).</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>