* [PATCH] m68k: Preserve fixups during dead code elimination
@ 2026-11-14 9:15 Christian Zietz via B4 Relay
2026-11-15 23:27 ` Daniel Palmer
2026-12-05 19:44 ` Christian Zietz
0 siblings, 2 replies; 4+ messages in thread
From: Christian Zietz via B4 Relay @ 2026-11-14 9:15 UTC (permalink / raw)
To: Geert Uytterhoeven, Sam Creasey; +Cc: linux-m68k, linux-kernel, Christian Zietz
From: Christian Zietz <czietz@gmx.net>
A kernel built with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y panics when
loaded into TT-RAM (starting at address 0x01000000) on Atari. This is
due to the .m68k_fixup section being removed by the linker's dead code
elimination. Thus, the kernel is not fixed up for the TT-RAM address.
KEEP() ensures the fixups are always kept in the kernel binary.
Tested on an Atari TT and under Hatari emulation.
Fixes: 4fbdd56edf1f ("m68k: Enable dead code elimination")
Signed-off-by: Christian Zietz <czietz@gmx.net>
---
For reference, here is the objdump output of a kernel built with
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y that shows .m68k_fixup is
missing:
m68k-linux-gnu-objdump -s -j .m68k_fixup vmlinux
vmlinux: file format elf32-m68k
m68k-linux-gnu-objdump: section '.m68k_fixup' mentioned in a -j option,
but not found in any input file
... versus after applying the patch:
m68k-linux-gnu-objdump -s -j .m68k_fixup vmlinux
vmlinux: file format elf32-m68k
Contents of section .m68k_fixup:
3c5a8c 00000000 003a8478 00000000 003aa6f8 .....:.x.....:..
3c5a9c 00000000 003aaafe 00000000 0000b5ae .....:..........
3c5aac 00000000 003aaed4 00000000 003aaefa .....:.......:..
3c5abc 00000000 0000c5f6 00000000 0000c61c ................
[...]
---
arch/m68k/kernel/vmlinux-nommu.lds | 2 +-
arch/m68k/kernel/vmlinux-std.lds | 2 +-
arch/m68k/kernel/vmlinux-sun3.lds | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds
index 45d7f4b01..485bbc24a 100644
--- a/arch/m68k/kernel/vmlinux-nommu.lds
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -72,7 +72,7 @@ SECTIONS {
PERCPU_SECTION(16)
.m68k_fixup : {
__start_fixup = .;
- *(.m68k_fixup)
+ KEEP(*(.m68k_fixup))
__stop_fixup = .;
}
.init.data : {
diff --git a/arch/m68k/kernel/vmlinux-std.lds b/arch/m68k/kernel/vmlinux-std.lds
index 7326586af..8783df430 100644
--- a/arch/m68k/kernel/vmlinux-std.lds
+++ b/arch/m68k/kernel/vmlinux-std.lds
@@ -45,7 +45,7 @@ SECTIONS
INIT_DATA_SECTION(16)
.m68k_fixup : {
__start_fixup = .;
- *(.m68k_fixup)
+ KEEP(*(.m68k_fixup))
__stop_fixup = .;
}
.init_end : {
diff --git a/arch/m68k/kernel/vmlinux-sun3.lds b/arch/m68k/kernel/vmlinux-sun3.lds
index 1b19fef20..8be83d13d 100644
--- a/arch/m68k/kernel/vmlinux-sun3.lds
+++ b/arch/m68k/kernel/vmlinux-sun3.lds
@@ -40,7 +40,7 @@ __init_begin = .;
INIT_DATA_SECTION(16)
.m68k_fixup : {
__start_fixup = .;
- *(.m68k_fixup)
+ KEEP(*(.m68k_fixup))
__stop_fixup = .;
}
. = ALIGN(PAGE_SIZE);
---
base-commit: 8c9ddebb300c719362a52a2d465f44e7d055778d
change-id: 20261113-fix_deadcode_elimination_for_tt_ram-6629928148f6
Best regards,
--
Christian Zietz <czietz@gmx.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] m68k: Preserve fixups during dead code elimination
2026-11-14 9:15 [PATCH] m68k: Preserve fixups during dead code elimination Christian Zietz via B4 Relay
@ 2026-11-15 23:27 ` Daniel Palmer
2026-11-24 1:29 ` Daniel Palmer
2026-12-05 19:44 ` Christian Zietz
1 sibling, 1 reply; 4+ messages in thread
From: Daniel Palmer @ 2026-11-15 23:27 UTC (permalink / raw)
To: czietz; +Cc: Geert Uytterhoeven, Sam Creasey, linux-m68k, linux-kernel
Hi Christian,
On Sat, 14 Nov 2026 at 18:16, Christian Zietz via B4 Relay
<devnull+czietz.gmx.net@kernel.org> wrote:
> Fixes: 4fbdd56edf1f ("m68k: Enable dead code elimination")
That's mine. I wonder if this explains why one of my m68k machines
would not boot with dead code elimination enabled. I forget which it
was now :)
Your change looks correct to me.
Acked-by: Daniel Palmer <daniel@thingy.jp>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] m68k: Preserve fixups during dead code elimination
2026-11-15 23:27 ` Daniel Palmer
@ 2026-11-24 1:29 ` Daniel Palmer
0 siblings, 0 replies; 4+ messages in thread
From: Daniel Palmer @ 2026-11-24 1:29 UTC (permalink / raw)
To: czietz; +Cc: Geert Uytterhoeven, Sam Creasey, linux-m68k, linux-kernel
Hi Daniel,
On Mon, 16 Nov 2026 at 08:27, Daniel Palmer <daniel@0x0f.com> wrote:
> That's mine. I wonder if this explains why one of my m68k machines
> would not boot with dead code elimination enabled. I forget which it
> was now :)
Tested on Amiga 4000 (060), MVME147 (030) and E17 (out of tree SMP 040
:)). Amiga apparently needs the fix to boot correctly.
The reduction in kernel size is ~8% for all of them.
So,
Tested-by: Daniel Palmer <daniel@thingy.jp>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] m68k: Preserve fixups during dead code elimination
2026-11-14 9:15 [PATCH] m68k: Preserve fixups during dead code elimination Christian Zietz via B4 Relay
2026-11-15 23:27 ` Daniel Palmer
@ 2026-12-05 19:44 ` Christian Zietz
1 sibling, 0 replies; 4+ messages in thread
From: Christian Zietz @ 2026-12-05 19:44 UTC (permalink / raw)
To: Geert Uytterhoeven, Sam Creasey; +Cc: linux-m68k, linux-kernel, Daniel Palmer
Hi Geert,
On Nov 14 2026, Christian Zietz via B4 Relay wrote:
> A kernel built with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y panics when
> loaded into TT-RAM (starting at address 0x01000000) on Atari. This is
> due to the .m68k_fixup section being removed by the linker's dead code
> elimination. Thus, the kernel is not fixed up for the TT-RAM address.
A gentle ping on this patch. It fixes a boot panic on Atari when the
kernel is loaded into TT-RAM and built with
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y, which is an advantageous
configuration for machines with little memory.
The patch has since received Acked-by and Tested-by tags. Could you
please have a look and pick it up for your tree, or let me know if you
would like any changes?
Thanks a lot and best regards,
Christian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-05 19:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-14 9:15 [PATCH] m68k: Preserve fixups during dead code elimination Christian Zietz via B4 Relay
2026-11-15 23:27 ` Daniel Palmer
2026-11-24 1:29 ` Daniel Palmer
2026-12-05 19:44 ` Christian Zietz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®