[llvm-commits] Commit 141135 breaks thumb assembly

James Molloy James.Molloy at arm.com
Fri Oct 14 01:59:09 PDT 2011


Hi Owen,

Your commit 141135 causes incorrect assembly to be output in Thumb mode. You modified MCAsmStreamer to emit mapping symbols at the beginning of code and data sections ('$a.0', '$d.0'). In thumb mode, it will also output an '$a' which is incorrect, as $a says that the following code is ARM-mode.

After assembly with GNU As, the correct '$t' mapping symbol is added by the assembler, which causes both a $a and a $t to be at the same address and confuses our linker (and would confuse most linkers and disassembly tools!):

.LBB0_2:                                @ %switch.case.1
$a.0:
        movw    r0, :lower16:Int_Glob
        movt    r0, :upper16:Int_Glob
        ldr     r0, [r0]
        cmp     r0, #101
        blt     .LBB0_4

Assembles to:

    $a
    $t
        0x00000018:    f2400000    @...    MOVW     r0,#:LOWER16: Int_Glob
        0x0000001c:    f2c00000    ....    MOVT     r0,#:UPPER16: Int_Glob
        0x00000020:    6800        .h      LDR      r0,[r0,#0]
        0x00000022:    2865        e(      CMP      r0,#0x65
        0x00000024:    db01        ..      BLT      {pc}+0x6 ; 0x2a

This is incorrect by the ABI - the mapping symbols contradict.

Could you please fix this?

Cheers,

James

-- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.





More information about the llvm-commits mailing list