Re: [PATCH 01/12] ARM: assembler: introduce adr_l, ldr_l and str_l macros
From: Nick Desaulniers <ndesaulniers@google.com>
Date: 2020-09-15 17:53:18
Also in:
linux-efi
On Tue, Sep 15, 2020 at 12:35 AM Ard Biesheuvel [off-list ref] wrote:
On Mon, 14 Sep 2020 at 12:57, Ard Biesheuvel [off-list ref] wrote:quoted
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index feac2c8b86f2..39e972eaaa3f 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h@@ -494,4 +494,88 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) #define _ASM_NOKPROBE(entry) #endif + .macro __adldst_l, op, reg, sym, tmp, c + .if __LINUX_ARM_ARCH__ < 7 + ldr\c \tmp, .La\@ + .subsection 1 + .align 2 +.La\@: .long \sym - .Lpc\@ + .previous + .else + .ifnb \c + THUMB( ittt \c ) + .endif + movw\c \tmp, #:lower16:\sym - .Lpc\@ + movt\c \tmp, #:upper16:\sym - .Lpc\@ + .endif + +#ifndef CONFIG_THUMB2_KERNEL + .set .Lpc\@, . + 8 // PC bias + .ifc \op, add + add\c \reg, \tmp, pc + .else + \op\c \reg, [\tmp, pc]This should be \op\c \reg, [pc, \tmp]
That looks better. I had tested this series yesterday and wasn't able to build with either toolchains. Was going to ask if I was using the wrong base or if there was an issue with my version binutils. All good now, I'll try to hammer on this a bit. -- Thanks, ~Nick Desaulniers _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel