[PATCH] arm: ensure consistent behaviour of ADR with thumb code

Laurent GONZALEZ lgonzalez at gezedo.com
Sun Mar 11 07:09:26 PDT 2018


binutils 2.29 changed ADR behaviour setting the LSB for thumb symbols.
Using the .eqv directive creates an untagged symbol, so that we can safely
add the LSB using an offseted relocation of the untagged symbol.

Signed-off-by: Laurent GONZALEZ <lgonzalez at gezedo.com>
---
 arch/arm/include/asm/assembler.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
index bc8d4bbd8..ed45451bc 100644
--- a/arch/arm/include/asm/assembler.h
+++ b/arch/arm/include/asm/assembler.h
@@ -195,7 +195,8 @@
 	.irp	c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
 	.macro	badr\c, rd, sym
 #ifdef CONFIG_THUMB2_KERNEL
-	adr\c	\rd, \sym + 1
+	.eqv	untagged_\sym, \sym
+	adr\c	\rd, untagged_\sym + 1
 #else
 	adr\c	\rd, \sym
 #endif
-- 
2.11.0




More information about the linux-arm-kernel mailing list