[LLVMbugs] [Bug 11219] New: Thumb 2: llvm-objdump skips and becomes misaligned

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Oct 23 23:24:09 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11219

           Summary: Thumb 2: llvm-objdump skips and becomes misaligned
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: ARM
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: xocotl at gmail.com
                CC: llvmbugs at cs.uiuc.edu


llvm-objdump becomes misaligned for this file:

llvm-objdump -arch=thumb -triple=thumb-none-eabi -disassemble BugOpt.elf >
test.txt

BugOpt.elf:    file format ELF32-arm

Disassembly of section .text:
.text:
       0:    20 20                                            movs    r0, #32
       2:    70 47                                            bx    lr
       4:    41 68                                            ldr    r1, [r0,
#4]
       6:    48 68                                            ldr    r0, [r1,
#4]
       8:    c9 68                                            ldr    r1, [r1,
#12]
       a:    08 1a                                            subs    r0, r1,
r0
       c:    20 28                                            cmp    r0, #32
       f:    bf 20 <--- No Thumb instructions are 3 bytes!                     
                     movs    r0, #191
      11:    20 70                                            strb    r0, [r4]
      13:    47 70                                            strb    r7, [r0,
#1]
      15:    47 c0                                            stm    r0!, {r0,
r1, r2, r6}
      17:    46 40                                            eors    r6, r0
      19:    68 c2                                            stm    r2!, {r3,
r5, r6}
      1b:    68 53                                            strh    r0, [r5,
r5]
      1d:    1c 02                                            lsls    r4, r3,
#8
      1f:    f0 1f                                            subs    r0, r6,
#7
      21:    02 c3                                            stm    r3!, {r1}
      23:    60 10                                            asrs    r0, r4,
#1
      25:    44 01                                            lsls    r4, r0,
#5
      27:    74 70                                            strb    r4, [r6,
#1]
      29:    47 c0                                            stm    r0!, {r0,
r1, r2, r6}

For reference, GNU Disasm gives:


bugopt.elf:     file format elf32-littlearm


Disassembly of section .text:

00000000 <_ZNK16RingSerialOutput12BufferLengthEv>:
   0:    2020          movs    r0, #32
   2:    4770          bx    lr

00000004 <_ZNK16RingSerialOutput11BytesQueuedEv>:
   4:    6841          ldr    r1, [r0, #4]
   6:    6848          ldr    r0, [r1, #4]
   8:    68c9          ldr    r1, [r1, #12]
   a:    1a08          subs    r0, r1, r0
   c:    2820          cmp    r0, #32
   e:    bf28          it    cs
  10:    2020          movcs    r0, #32
  12:    4770          bx    lr

So you can see it occurs at the first IT statement.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list