<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 --- - missassembly of call to aligned local symbol"
   href="http://llvm.org/bugs/show_bug.cgi?id=21997">21997</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>missassembly of call to aligned local symbol
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>tools
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </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-as
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>luddy.harrison@gmail.com
          </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=13583" name="attach_13583" title="foo.s: example of bug; bar.s: fixed by moving L downstream">attachment 13583</a> <a href="attachment.cgi?id=13583&action=edit" title="foo.s: example of bug; bar.s: fixed by moving L downstream">[details]</a></span>
foo.s: example of bug; bar.s: fixed by moving L downstream

when .balign is applied to a local label in the text section, and that symbol
is called at a later point in the same assembly file, the assembler appears to
generate an incorrect relocation that causes a bad pc to be formed by the call.
 the result is a bus error.  the bug seems not to occur if the aligned local
symbol is downstream of
the call site.

I've attached a small test case that reproduces the behavior.  here's the
offending code:

    .globl    _main
    .text
    .balign 1<<4, 0x90
L:
    ret
_main:
    call L // gets a bad pc for L
    xorq %rax, %rax
    ret</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>