https://sourceware.org/bugzilla/show_bug.cgi?id=18541

            Bug ID: 18541
           Summary: ARM: adr reference to global symbol fails to assemble
                    in Thumb mode
           Product: binutils
           Version: 2.24
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: ard.biesheuvel at linaro dot org
  Target Milestone: ---

The following ARM code fails to assemble in Thumb mode

"""
    adr r0, cp15_save_power

    .align
    .globl cp15_save_power
cp15_save_power:
    .long 0 @ cp15 power control
"""

$ arm-linux-gnueabihf-as -o /tmp/sleep.o /tmp/sleep.S -mthumb
/tmp/sleep.S: Assembler messages:
/tmp/sleep.S:1: Error: invalid immediate for address calculation
(value = 0x00000004)

The error goes away when I drop the -mthumb or when I replace the code with
"""
    adr r0, 0f

    .align
    .globl cp15_save_power
cp15_save_power:
0:  .long 0 @ cp15 power control
"""

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to