<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 - [arm][thumb2][integrated as] incorrect padding at end of code sequence"
   href="https://bugs.llvm.org/show_bug.cgi?id=51929">51929</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[arm][thumb2][integrated as] incorrect padding at end of code sequence
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>ndesaulniers@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>kristof.beyls@arm.com, llvm-bugs@lists.llvm.org, natechancellor@gmail.com, rengolin@gmail.com, smithp352@googlemail.com, srhines@google.com, Ties.Stuij@arm.com
          </td>
        </tr>

        <tr>
          <th>Blocks</th>
          <td>4068
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Via: <a href="https://github.com/ClangBuiltLinux/linux/issues/1447">https://github.com/ClangBuiltLinux/linux/issues/1447</a>

$ clang --target=arm-linux-gnueabi -Wa,-mthumb tlb-v7.s -o clang.o
-Wa,-march=armv7-a -c

and

$ clang --target=arm-linux-gnueabi -Wa,-mthumb tlb-v7.s -o gas.o
-Wa,-march=armv7-a -c -fno-integrated-as

produce different output given the input:

.align 0
mov pc, lr

ie.

$ llvm-objdump -dr clang.o  | tail -n2
00000000 <$t.0>:
       0: f7 46         mov     pc, lr
$ llvm-objdump -dr gas.o  | tail -n3
00000000 <$t>:
       0: f7 46         mov     pc, lr
       2: 00 bf         nop


This looks somewhat related perhaps to
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - [arm assembler]: Incorrect alignment NOPs in mixed ARM and Thumb assembly"
   href="show_bug.cgi?id=48512">https://bugs.llvm.org/show_bug.cgi?id=48512</a>.  Looking throught GAS' issue
tracker, I think this might be the equivalent bug.

<a href="https://sourceware.org/bugzilla/show_bug.cgi?id=12931">https://sourceware.org/bugzilla/show_bug.cgi?id=12931</a>

This difference in behavior seems to be causing a boot failure for THUMB2 linux
kernels assembled with Clang in QEMU 6.2.0+.</pre>
        </div>
      </p>

        <div id="referenced">
          <hr style="border: 1px dashed #969696">
          <b>Referenced Bugs:</b>
          <ul>
              <li>
                [<a class="bz_bug_link 
          bz_status_CONFIRMED "
   title="CONFIRMED - [Meta] Compiling the Linux kernel with clang"
   href="https://bugs.llvm.org/show_bug.cgi?id=4068">Bug 4068</a>] [Meta] Compiling the Linux kernel with clang
              </li>
          </ul>
        </div>
        <br>

      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>