| 1 |
From f84794adaae5d5cc9e2b83b19c8c42b93e50b5ff Mon Sep 17 00:00:00 2001 |
| 2 |
Message-ID: <f84794adaae5d5cc9e2b83b19c8c42b93e50b5ff.1762765390.git.osandov@osandov.com> |
| 3 |
From: Nathan Chancellor <[email protected]> |
| 4 |
Date: Wed, 3 Sep 2025 14:11:58 -0700 |
| 5 |
Subject: [PATCH] powerpc: boot: Remove leading zero in label in udelay() |
| 6 |
|
| 7 |
When building powerpc configurations in linux-5.4.y with binutils 2.43 |
| 8 |
or newer, there is an assembler error in arch/powerpc/boot/util.S: |
| 9 |
|
| 10 |
arch/powerpc/boot/util.S: Assembler messages: |
| 11 |
arch/powerpc/boot/util.S:44: Error: junk at end of line, first unrecognized character is `0' |
| 12 |
arch/powerpc/boot/util.S:49: Error: syntax error; found `b', expected `,' |
| 13 |
arch/powerpc/boot/util.S:49: Error: junk at end of line: `b' |
| 14 |
|
| 15 |
binutils 2.43 contains stricter parsing of certain labels [1], namely |
| 16 |
that leading zeros are no longer allowed. The GNU assembler |
| 17 |
documentation already somewhat forbade this construct: |
| 18 |
|
| 19 |
To define a local label, write a label of the form 'N:' (where N |
| 20 |
represents any non-negative integer). |
| 21 |
|
| 22 |
Eliminate the leading zero in the label to fix the syntax error. This is |
| 23 |
only needed in linux-5.4.y because commit 8b14e1dff067 ("powerpc: Remove |
| 24 |
support for PowerPC 601") removed this code altogether in 5.10. |
| 25 |
|
| 26 |
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=226749d5a6ff0d5c607d6428d6c81e1e7e7a994b [1] |
| 27 |
Signed-off-by: Nathan Chancellor <[email protected]> |
| 28 |
Reviewed-by: Christophe Leroy <[email protected]> |
| 29 |
Signed-off-by: Greg Kroah-Hartman <[email protected]> |
| 30 |
--- |
| 31 |
arch/powerpc/boot/util.S | 4 ++-- |
| 32 |
1 file changed, 2 insertions(+), 2 deletions(-) |
| 33 |
|
| 34 |
diff --git a/arch/powerpc/boot/util.S b/arch/powerpc/boot/util.S |
| 35 |
index f11f0589a669f..5ab2bc864e660 100644 |
| 36 |
--- a/arch/powerpc/boot/util.S |
| 37 |
+++ b/arch/powerpc/boot/util.S |
| 38 |
@@ -41,12 +41,12 @@ udelay: |
| 39 |
srwi r4,r4,16 |
| 40 |
cmpwi 0,r4,1 /* 601 ? */ |
| 41 |
bne .Ludelay_not_601 |
| 42 |
-00: li r0,86 /* Instructions / microsecond? */ |
| 43 |
+0: li r0,86 /* Instructions / microsecond? */ |
| 44 |
mtctr r0 |
| 45 |
10: addi r0,r0,0 /* NOP */ |
| 46 |
bdnz 10b |
| 47 |
subic. r3,r3,1 |
| 48 |
- bne 00b |
| 49 |
+ bne 0b |
| 50 |
blr |
| 51 |
|
| 52 |
.Ludelay_not_601: |
| 53 |
-- |
| 54 |
2.47.3 |
| 55 |
|