public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH] m68k: Fix invalid .section syntax
@ 2023-06-16 15:36 Ben Hutchings
  2023-06-23 11:34 ` Jan-Benedict Glaw
  2023-07-24 12:58 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Ben Hutchings @ 2023-06-16 15:36 UTC (permalink / raw)
  To: linux-m68k

[-- Attachment #1: Type: text/plain, Size: 2559 bytes --]

From: Ben Hutchings <benh@debian.org>

gas supports several different forms for .section for ELF targets,
including:
    .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
and:
    .section "NAME"[, #FLAGS...]

In several places we use a mix of these two forms:
    .section NAME, #FLAGS...

A current development snapshot of binutils (2.40.50.20230611) treats
this mixed syntax as an error.

Change to consistently use:
    .section NAME, "FLAGS"
as is used elsewhere in the kernel.

References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=m68k&ver=6.4%7Erc6-1%7Eexp1&stamp=1686907300&raw=1
Signed-off-by: Ben Hutchings <benh@debian.org>
---
These changes are compile-tested only.

Ben.

 arch/m68k/fpsp040/skeleton.S       | 4 ++--
 arch/m68k/ifpsp060/os.S            | 4 ++--
 arch/m68k/kernel/relocate_kernel.S | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/m68k/fpsp040/skeleton.S b/arch/m68k/fpsp040/skeleton.S
index 439395aa6fb4..081922c72daa 100644
--- a/arch/m68k/fpsp040/skeleton.S
+++ b/arch/m68k/fpsp040/skeleton.S
@@ -499,13 +499,13 @@
 	dbf	%d0,morein
 	rts
 
-	.section .fixup,#alloc,#execinstr
+	.section .fixup,"ax"
 	.even
 1:
 	jbsr	fpsp040_die
 	jbra	.Lnotkern
 
-	.section __ex_table,#alloc
+	.section __ex_table,"a"
 	.align	4
 
 	.long	in_ea,1b
diff --git a/arch/m68k/ifpsp060/os.S b/arch/m68k/ifpsp060/os.S
index 7a0d6e428066..89e2ec224ab6 100644
--- a/arch/m68k/ifpsp060/os.S
+++ b/arch/m68k/ifpsp060/os.S
@@ -379,11 +379,11 @@ dmwls:	move.l		%d0,(%a0)		| store super longword
 
 
 | Execption handling for movs access to illegal memory
-	.section .fixup,#alloc,#execinstr
+	.section .fixup,"ax"
 	.even
 1:	moveq		#-1,%d1
 	rts
-.section __ex_table,#alloc
+.section __ex_table,"a"
 	.align 4
 	.long	dmrbuae,1b
 	.long	dmrwuae,1b
diff --git a/arch/m68k/kernel/relocate_kernel.S b/arch/m68k/kernel/relocate_kernel.S
index ab0f1e7d4653..f7667079e08e 100644
--- a/arch/m68k/kernel/relocate_kernel.S
+++ b/arch/m68k/kernel/relocate_kernel.S
@@ -26,7 +26,7 @@ ENTRY(relocate_new_kernel)
 	lea %pc@(.Lcopy),%a4
 2:	addl #0x00000000,%a4		/* virt_to_phys() */
 
-	.section ".m68k_fixup","aw"
+	.section .m68k_fixup,"aw"
 	.long M68K_FIXUP_MEMOFFSET, 2b+2
 	.previous
 
@@ -49,7 +49,7 @@ ENTRY(relocate_new_kernel)
 	lea %pc@(.Lcont040),%a4
 5:	addl #0x00000000,%a4		/* virt_to_phys() */
 
-	.section ".m68k_fixup","aw"
+	.section .m68k_fixup,"aw"
 	.long M68K_FIXUP_MEMOFFSET, 5b+2
 	.previous
 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k: Fix invalid .section syntax
  2023-06-16 15:36 [PATCH] m68k: Fix invalid .section syntax Ben Hutchings
@ 2023-06-23 11:34 ` Jan-Benedict Glaw
  2023-07-24 12:58 ` Geert Uytterhoeven
  1 sibling, 0 replies; 5+ messages in thread
From: Jan-Benedict Glaw @ 2023-06-23 11:34 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k, Ben Hutchings

[-- Attachment #1: Type: text/plain, Size: 2228 bytes --]

Hi!

On Fri, 2023-06-16 17:36:10 +0200, Ben Hutchings <ben@decadent.org.uk> wrote:
> gas supports several different forms for .section for ELF targets,
> including:
>     .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
> and:
>     .section "NAME"[, #FLAGS...]
> 
> In several places we use a mix of these two forms:
>     .section NAME, #FLAGS...
> 
> A current development snapshot of binutils (2.40.50.20230611) treats
> this mixed syntax as an error.

I stepped into this as well, and think it's a bad thing to break
working code along with giving a bad error message:

[mk all 2023-06-23 08:34:34] # AS      arch/m68k/fpsp040/skeleton.o
[mk all 2023-06-23 08:34:34]   m68k-linux-gcc -Wp,-MMD,arch/m68k/fpsp040/.skeleton.o.d -nostdinc -I./arch/m68k/include -I./arch/m68k/include/generated  -I./include -I./arch/m68k/include/uapi -I./arch/m68k/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/compiler-version.h -include ./include/linux/kconfig.h -D__KERNEL__ -fmacro-prefix-map=./= -D__ASSEMBLY__ -fno-PIE -m68040    -c -o arch/m68k/fpsp040/skeleton.o arch/m68k/fpsp040/skeleton.S 
[mk all 2023-06-23 08:34:34] arch/m68k/fpsp040/skeleton.S: Assembler messages:
[mk all 2023-06-23 08:34:34] arch/m68k/fpsp040/skeleton.S:502: Error: junk at end of line, first unrecognized character is `#'
[mk all 2023-06-23 08:34:34] arch/m68k/fpsp040/skeleton.S:508: Error: junk at end of line, first unrecognized character is `#'
[mk all 2023-06-23 08:34:34] make[3]: *** [scripts/Makefile.build:374: arch/m68k/fpsp040/skeleton.o] Error 1
[mk all 2023-06-23 08:34:34] make[2]: *** [scripts/Makefile.build:494: arch/m68k/fpsp040] Error 2
[mk all 2023-06-23 08:34:34] make[1]: *** [scripts/Makefile.build:494: arch/m68k] Error 2
[mk all 2023-06-23 08:34:34] make: *** [Makefile:2026: .] Error 2

> References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=m68k&ver=6.4%7Erc6-1%7Eexp1&stamp=1686907300&raw=1
> Signed-off-by: Ben Hutchings <benh@debian.org>

As per pers.comm. with Geert:

References: http://toolchain.lug-owl.de/laminar/jobs/linux-m68k-virt_defconfig/34
Tested-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>

MfG, JBG

-- 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k: Fix invalid .section syntax
  2023-06-16 15:36 [PATCH] m68k: Fix invalid .section syntax Ben Hutchings
  2023-06-23 11:34 ` Jan-Benedict Glaw
@ 2023-07-24 12:58 ` Geert Uytterhoeven
  2023-07-24 17:37   ` Ben Hutchings
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2023-07-24 12:58 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-m68k

Hi Ben,

On Fri, Jun 16, 2023 at 5:47 PM Ben Hutchings <ben@decadent.org.uk> wrote:
> From: Ben Hutchings <benh@debian.org>
>
> gas supports several different forms for .section for ELF targets,
> including:
>     .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
> and:
>     .section "NAME"[, #FLAGS...]
>
> In several places we use a mix of these two forms:
>     .section NAME, #FLAGS...
>
> A current development snapshot of binutils (2.40.50.20230611) treats
> this mixed syntax as an error.
>
> Change to consistently use:
>     .section NAME, "FLAGS"
> as is used elsewhere in the kernel.
>
> References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=m68k&ver=6.4%7Erc6-1%7Eexp1&stamp=1686907300&raw=1
> Signed-off-by: Ben Hutchings <benh@debian.org>

Thanks for your patch! Consistency is good.

Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org>
i.e. applied and queued.

> ---
> These changes are compile-tested only.

I verified there is no difference in the generated object files with my
current toolchain (GNU assembler version 2.38 (m68k-linux-gnu)
using BFD version (GNU Binutils for Ubuntu) 2.38).

Do you think it's worthwhile to fast-track this for v6.5, or is it fine to
queue this for v6.6?

Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k: Fix invalid .section syntax
  2023-07-24 12:58 ` Geert Uytterhoeven
@ 2023-07-24 17:37   ` Ben Hutchings
  2023-07-25  7:01     ` Geert Uytterhoeven
  0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2023-07-24 17:37 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-m68k

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Mon, 2023-07-24 at 14:58 +0200, Geert Uytterhoeven wrote:
> Hi Ben,
> 
> On Fri, Jun 16, 2023 at 5:47 PM Ben Hutchings <ben@decadent.org.uk> wrote:
> > From: Ben Hutchings <benh@debian.org>
> > 
> > gas supports several different forms for .section for ELF targets,
> > including:
> >     .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
> > and:
> >     .section "NAME"[, #FLAGS...]
> > 
> > In several places we use a mix of these two forms:
> >     .section NAME, #FLAGS...
> > 
> > A current development snapshot of binutils (2.40.50.20230611) treats
> > this mixed syntax as an error.
[...]
> I verified there is no difference in the generated object files with my
> current toolchain (GNU assembler version 2.38 (m68k-linux-gnu)
> using BFD version (GNU Binutils for Ubuntu) 2.38).
> 
> Do you think it's worthwhile to fast-track this for v6.5, or is it fine to
> queue this for v6.6?

The new version of binutils has been in Debian unstable for over a
month now.  I think this should be fast-tracked.

Ben.

-- 
Ben Hutchings
When in doubt, use brute force. - Ken Thompson


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] m68k: Fix invalid .section syntax
  2023-07-24 17:37   ` Ben Hutchings
@ 2023-07-25  7:01     ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2023-07-25  7:01 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-m68k

Hi Ben,

On Mon, Jul 24, 2023 at 7:37 PM Ben Hutchings <ben@decadent.org.uk> wrote:
> On Mon, 2023-07-24 at 14:58 +0200, Geert Uytterhoeven wrote:
> > On Fri, Jun 16, 2023 at 5:47 PM Ben Hutchings <ben@decadent.org.uk> wrote:
> > > From: Ben Hutchings <benh@debian.org>
> > >
> > > gas supports several different forms for .section for ELF targets,
> > > including:
> > >     .section NAME [, "FLAGS"[, @TYPE[,FLAG_SPECIFIC_ARGUMENTS]]]
> > > and:
> > >     .section "NAME"[, #FLAGS...]
> > >
> > > In several places we use a mix of these two forms:
> > >     .section NAME, #FLAGS...
> > >
> > > A current development snapshot of binutils (2.40.50.20230611) treats
> > > this mixed syntax as an error.
> [...]
> > I verified there is no difference in the generated object files with my
> > current toolchain (GNU assembler version 2.38 (m68k-linux-gnu)
> > using BFD version (GNU Binutils for Ubuntu) 2.38).
> >
> > Do you think it's worthwhile to fast-track this for v6.5, or is it fine to
> > queue this for v6.6?
>
> The new version of binutils has been in Debian unstable for over a
> month now.  I think this should be fast-tracked.

OK, PR sent.
Thanks!

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-25  7:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16 15:36 [PATCH] m68k: Fix invalid .section syntax Ben Hutchings
2023-06-23 11:34 ` Jan-Benedict Glaw
2023-07-24 12:58 ` Geert Uytterhoeven
2023-07-24 17:37   ` Ben Hutchings
2023-07-25  7:01     ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox