Re: RTL9300 (mips) fails to boot with commit d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output section")

From: Rong Xu
Date: Fri Nov 22 2024 - 00:02:35 EST


Does the following patch fix your issue?
https://lore.kernel.org/lkml/CAK7LNAQSpM2hh2=Wgribb92nHF5_peRb+gxdO1Bt1MkeL8N+hw@xxxxxxxxxxxxxx/t/

Masahiro Yamada already applied the patch to kbuild-tree.

I also proposed a similar fix as yours. But we believe the above patch
should also work (and probably is better).

Please try and let us know.

Thanks!

-Rong

On Thu, Nov 21, 2024 at 6:29 PM Chris Packham
<chris.packham@xxxxxxxxxxxxxxxxxxx> wrote:
>
>
> On 22/11/24 14:58, Chris Packham wrote:
> > Hi Rong,
> >
> > I was just trying some of my in-flight changes against linux-next and
> > found that my RTL9300* based board no longer boots (nothing on the
> > serial console after U-Boot hands off to the kernel).
> >
> > A bisect between Linus's tree and linux-next/master points to commit
> > d4a7f2510ff4 ("vmlinux.lds.h: Adjust symbol ordering in text output
> > section"). A build on d4a7f2510ff4^ boots successfully. That series is
> > well beyond my area of knowledge, there may be something that the MIPS
> > SoCs are doing (or not doing) that is being affected by the sections
> > moving.
>
> Based on the sparc change that accompanied this commit the following
> does seem to restore working order for me:
>
> diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S
> index d575f945d422..e90b0f68290c 100644
> --- a/arch/mips/kernel/vmlinux.lds.S
> +++ b/arch/mips/kernel/vmlinux.lds.S
> @@ -62,6 +62,8 @@ SECTIONS
> _text = .; /* Text and read-only data */
> _stext = .;
> .text : {
> + /* Match text section symbols in head.S first */
> + *head.o(.text)
> TEXT_TEXT
> SCHED_TEXT
> LOCK_TEXT
>
> No idea if that's appropriate
>