<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 - Function symbol from assembler misses lowest bit set in Thumb mode"
   href="https://bugs.llvm.org/show_bug.cgi?id=44860">44860</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Function symbol from assembler misses lowest bit set in Thumb mode
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </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>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: ARM
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>stefan@agner.ch
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, peter.smith@linaro.org, Ties.Stuij@arm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23113" name="attach_23113" title="reproducer assembly">attachment 23113</a> <a href="attachment.cgi?id=23113&action=edit" title="reproducer assembly">[details]</a></span>
reproducer assembly

Using the .type directive to mark a label as a function in Thumb mode does not
get the correct symbol table entry.

        .syntax unified
        .text
        .thumb
__setup_mmu:
        it ne
        blne __setup_mmu
        .type __setup_mmu, %function // Move this line before __setup_mmu for
correct behaviour.

llvm-mc --triple=armv7a-linux-gnueabihf blne.s -filetype=obj -o blne.o
--arm-add-build-attributes
llvm-readelf --symbols blne.o

Symbol table '.symtab' contains 3 entries:
   Num:    Value  Size Type    Bind   Vis       Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT   UND
     1: 00000000     0 NOTYPE  LOCAL  DEFAULT     2 $t.0
     2: 00000000     0 FUNC    LOCAL  DEFAULT     2 __setup_mmu


This has been observed when trying to build Linux for 32-bit ARM in Thumb2
mode. When the object file gets linked, the linker inserts a blx instruction
which switches the CPU instruction set...</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>