[llvm-commits] Commit 141135 breaks thumb assembly

Owen Anderson resistor at mac.com
Fri Oct 14 13:29:10 PDT 2011


James,

This will actually be somewhat hard to implement (or at least will require adding knowledge of Thumb to target-independent bits).  I think I'll disable mapping symbols on ELF targets.  On MachO, we don't have different mapping symbols for ARM/Thumb modes.

--Owen

On Oct 14, 2011, at 1:59 AM, James Molloy wrote:

> 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