From: Rob Landley <rob@landley.net>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Russell King <linux@armlinux.org.uk>,
Christian Eggers <ceggers@arri.de>, Arnd Bergmann <arnd@arndb.de>,
Yuntao Liu <liuyuntao12@huawei.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Rich Felker <dalias@libc.org>
Subject: Re: [PATCH 1/2] ARM: Require linker to support KEEP within OVERLAY for DCE
Date: Sat, 5 Jul 2025 14:53:43 -0500 [thread overview]
Message-ID: <c662505b-9c19-49f7-9823-80ccde72009f@landley.net> (raw)
In-Reply-To: <20250705002402.GA1968690@ax162>
On 7/4/25 19:24, Nathan Chancellor wrote:
> Hmm, I do see a bug in that change, as it allows DCE to be turned on
> with binutils older than 2.36, which should be avoided with something
> like
>
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 3072731fe09c..962451e54fdd 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -121,7 +121,7 @@ config ARM
> select HAVE_KERNEL_XZ
> select HAVE_KPROBES if !XIP_KERNEL && !CPU_ENDIAN_BE32 && !CPU_V7M
> select HAVE_KRETPROBES if HAVE_KPROBES
> - select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_CAN_USE_KEEP_IN_OVERLAY)
> + select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if (LD_VERSION >= 23600 || LD_IS_LLD) && LD_CAN_USE_KEEP_IN_OVERLAY
> select HAVE_MOD_ARCH_SPECIFIC
> select HAVE_NMI
> select HAVE_OPTPROBES if !THUMB2_KERNEL
>
> but it does not seem like your test configuration enables
> CONFIG_LD_DEAD_CODE_DATA_ELIMINATION so I would expect this change to be
> a no-op in that case? Does the above change work for you? I won't be
> free to validate this until after the weekend.
That fixed it, thanks.
AS arch/arm/boot/compressed/piggy.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready
$ qemu-system-arm -M virt -nographic -no-reboot -kernel $(find . -name
zImage) -append console=ttyAMA0
Booting Linux on physical CPU 0x0
Linux version 6.15.0-dirty (landley@driftwood)
(armv7l-linux-musleabihf-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.33.1)
#1 Sat Jul 5 14:40:16 CDT 2025
CPU: ARMv7 Processor [414fc0f0] revision 0 (ARMv7), cr=30c53c7d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
OF: fdt: Machine model: linux,dummy-virt
...
I note it was a host tool segfaulting. It seems unlikely the host was
running an arm binary, maybe something went off into la-la land trying
to parse unexpected ELF tables?
Appropriately-tagged-by: Rob Landley <rob@landley.net>
> Cheers,
> Nathan
Thanks,
Rob
next prev parent reply other threads:[~2025-07-05 22:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-11 19:43 [PATCH 0/2] ARM: Fix ARM_VECTORS with CONFIG_LD_DEAD_CODE_DATA_ELIMINATION Nathan Chancellor
2025-03-11 19:43 ` [PATCH 1/2] ARM: Require linker to support KEEP within OVERLAY for DCE Nathan Chancellor
2025-03-13 8:48 ` Linus Walleij
2025-07-04 19:15 ` Rob Landley
2025-07-05 0:24 ` Nathan Chancellor
2025-07-05 19:53 ` Rob Landley [this message]
2025-03-11 19:43 ` [PATCH 2/2] ARM: add KEEP() keyword to ARM_VECTORS Nathan Chancellor
2025-03-13 8:49 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c662505b-9c19-49f7-9823-80ccde72009f@landley.net \
--to=rob@landley.net \
--cc=arnd@arndb.de \
--cc=ceggers@arri.de \
--cc=dalias@libc.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=liuyuntao12@huawei.com \
--cc=nathan@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox