[PATCH v2 2/5] powerpc/boot: Fix crt0.S syntax for clang

Joel Stanley joel at jms.id.au
Fri Sep 14 14:06:46 AEST 2018


Clang's assembler does not like the syntax of the cmpdi:

 arch/powerpc/boot/crt0.S:168:22: error: unexpected modifier on variable reference
         cmpdi   12,RELACOUNT at l
                              ^
 arch/powerpc/boot/crt0.S:168:11: error: unknown operand
         cmpdi   12,RELACOUNT at l
                   ^
Enclosing RELACOUNT in () makes it is happy. Tested with GCC 8 and Clang
8 (trunk).

Reported to clang as https://bugs.llvm.org/show_bug.cgi?id=38945

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
v2: Fix for !powerpc64 too, add bug link to commit message
---
 arch/powerpc/boot/crt0.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index dcf2f15e6797..e453e011d7e7 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -80,7 +80,7 @@ p_base:	mflr	r10		/* r10 now points to runtime addr of p_base */
 	lwz	r9,4(r12)	/* get RELA pointer in r9 */
 	b	12f
 11:	addis	r8,r8,(-RELACOUNT)@ha
-	cmpwi	r8,RELACOUNT at l
+	cmpwi	r8,(RELACOUNT)@l
 	bne	12f
 	lwz	r0,4(r12)	/* get RELACOUNT value in r0 */
 12:	addi	r12,r12,8
@@ -165,7 +165,7 @@ p_base:	mflr	r10		/* r10 now points to runtime addr of p_base */
 	ld	r13,8(r11)       /* get RELA pointer in r13 */
 	b	11f
 10:	addis	r12,r12,(-RELACOUNT)@ha
-	cmpdi	r12,RELACOUNT at l
+	cmpdi	r12,(RELACOUNT)@l
 	bne	11f
 	ld	r8,8(r11)       /* get RELACOUNT value in r8 */
 11:	addi	r11,r11,16
-- 
2.17.1



More information about the Linuxppc-dev mailing list