Skip to contentSkip to conversation

powerpc: boot: Remove leading zero in label in udelay()

PATCH Applied Nathan Chancellor 4 participants 4 messages Sep 3, 2025 – Sep 4, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: boot: Remove leading zero in label in udelay()

When building powerpc configurations in linux-5.4.y with binutils 2.43 or newer, there is an assembler error in arch/powerpc/boot/util.S:

arch/powerpc/boot/util.S: Assembler messages:
arch/powerpc/boot/util.S:44: Error: junk at end of line, first unrecognized character is 0' arch/powerpc/boot/util.S:49: Error: syntax error; found b', expected ,' arch/powerpc/boot/util.S:49: Error: junk at end of line: b'

binutils 2.43 contains stricter parsing of certain labels [1], namely that leading zeros are no longer allowed. The GNU assembler documentation already somewhat forbade this construct:

To define a local label, write a label of the form 'N:' (where N represents any non-negative integer).

Eliminate the leading zero in the label to fix the syntax error. This is only needed in linux-5.4.y because commit 8b14e1dff067 ("powerpc: Remove support for PowerPC 601") removed this code altogether in 5.10.

---
v1 -> v2:
- Adjust commit message to make it clearer this construct was already incorrect under the existing GNU assembler documentation (Segher)

v1: https://lore.kernel.org/[email protected]/

---
 arch/powerpc/boot/util.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/util.S +2 -2
index f11f0589a669..5ab2bc864e66 100644
@@ -41,12 +41,12 @@ udelay:
 	srwi	r4,r4,16
 	cmpwi	0,r4,1		/* 601 ? */
 	bne	.Ludelay_not_601
-00:	li	r0,86	/* Instructions / microsecond? */
+0:	li	r0,86	/* Instructions / microsecond? */
 	mtctr	r0
 10:	addi	r0,r0,0 /* NOP */
 	bdnz	10b
 	subic.	r3,r3,1
-	bne	00b
+	bne	0b
 	blr
 
 .Ludelay_not_601:

base-commit: c25f780e491e4734eb27d65aa58e0909fd78ad9f

Signature · 1 line
2.51.0
#1 lore raw
FYI: kernel test robot notices the stable kernel rule is not satisfied.

Hi,

Thanks for your patch.

FYI: kernel test robot notices the stable kernel rule is not satisfied.

The check is based on https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html#option-3

Rule: The upstream commit ID must be specified with a separate line above the commit text.
Subject: [PATCH 5.4 only v2] powerpc: boot: Remove leading zero in label in udelay()

Please ignore this mail if the patch is not relevant for upstream.

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Reviewed-by on v2 1/1
#2 lore raw
In reply to Nathan Chancellor

Le 03/09/2025 à 23:11, Nathan Chancellor a écrit :

Quoted 15 lines

When building powerpc configurations in linux-5.4.y with binutils 2.43 or newer, there is an assembler error in arch/powerpc/boot/util.S:

arch/powerpc/boot/util.S: Assembler messages:
arch/powerpc/boot/util.S:44: Error: junk at end of line, first unrecognized character is 0' arch/powerpc/boot/util.S:49: Error: syntax error; found b', expected ,' arch/powerpc/boot/util.S:49: Error: junk at end of line: b'

binutils 2.43 contains stricter parsing of certain labels [1], namely that leading zeros are no longer allowed. The GNU assembler documentation already somewhat forbade this construct:

To define a local label, write a label of the form 'N:' (where N represents any non-negative integer).

Quoted 6 lines

Eliminate the leading zero in the label to fix the syntax error. This is only needed in linux-5.4.y because commit 8b14e1dff067 ("powerpc: Remove support for PowerPC 601") removed this code altogether in 5.10.

Quoted 31 lines

---
v1 -> v2:
- Adjust commit message to make it clearer this construct was already incorrect under the existing GNU assembler documentation (Segher)

v1: https://lore.kernel.org/[email protected]/

---
  arch/powerpc/boot/util.S | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/util.S +2 -2
index f11f0589a669..5ab2bc864e66 100644
@@ -41,12 +41,12 @@ udelay:
  	srwi	r4,r4,16
  	cmpwi	0,r4,1		/* 601 ? */
  	bne	.Ludelay_not_601
-00:	li	r0,86	/* Instructions / microsecond? */
+0:	li	r0,86	/* Instructions / microsecond? */
  	mtctr	r0
  10:	addi	r0,r0,0 /* NOP */
  	bdnz	10b
  	subic.	r3,r3,1
-	bne	00b
+	bne	0b
  	blr
 
  .Ludelay_not_601:

base-commit: c25f780e491e4734eb27d65aa58e0909fd78ad9f

maintainer Applied
#3 lore raw

Patch "powerpc: boot: Remove leading zero in label in udelay()" has been added to the 5.4-stable tree

In reply to Nathan Chancellor

This is a note to let you know that I've just added the patch titled

powerpc: boot: Remove leading zero in label in udelay()

to the 5.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
powerpc-boot-remove-leading-zero-in-label-in-udelay.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Thu Sep 4 18:03:41 2025
From: Nathan Chancellor <[email protected]>
Date: Wed, 3 Sep 2025 14:11:58 -0700
Subject: powerpc: boot: Remove leading zero in label in udelay()
To: Greg Kroah-Hartman <[email protected]>, Sasha Levin <[email protected]>
Cc: [email protected], Madhavan Srinivasan <[email protected]>, Michael Ellerman <[email protected]>, Nicholas Piggin <[email protected]>, Christophe Leroy <[email protected]>, [email protected], Nathan Chancellor <[email protected]>
Message-ID: <[email protected]>

From: Nathan Chancellor <[email protected]>

When building powerpc configurations in linux-5.4.y with binutils 2.43 or newer, there is an assembler error in arch/powerpc/boot/util.S:

arch/powerpc/boot/util.S: Assembler messages:
arch/powerpc/boot/util.S:44: Error: junk at end of line, first unrecognized character is 0' arch/powerpc/boot/util.S:49: Error: syntax error; found b', expected ,' arch/powerpc/boot/util.S:49: Error: junk at end of line: b'

binutils 2.43 contains stricter parsing of certain labels [1], namely that leading zeros are no longer allowed. The GNU assembler documentation already somewhat forbade this construct:

To define a local label, write a label of the form 'N:' (where N represents any non-negative integer).

Eliminate the leading zero in the label to fix the syntax error. This is only needed in linux-5.4.y because commit 8b14e1dff067 ("powerpc: Remove support for PowerPC 601") removed this code altogether in 5.10.

---
 arch/powerpc/boot/util.S |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/boot/util.S +2 -2
@@ -41,12 +41,12 @@ udelay:
 	srwi	r4,r4,16
 	cmpwi	0,r4,1		/* 601 ? */
 	bne	.Ludelay_not_601
-00:	li	r0,86	/* Instructions / microsecond? */
+0:	li	r0,86	/* Instructions / microsecond? */
 	mtctr	r0
 10:	addi	r0,r0,0 /* NOP */
 	bdnz	10b
 	subic.	r3,r3,1
-	bne	00b
+	bne	0b
 	blr
 
 .Ludelay_not_601:

Patches currently in stable-queue which might be from [email protected] are

queue-5.4/powerpc-boot-remove-leading-zero-in-label-in-udelay.patch