[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAS6rG2Pez+r1UWpWccokKBRVgjoYrxf+_+s2H98BFukhA@mail.gmail.com>
Date: Thu, 14 Nov 2024 06:17:13 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Rong Xu <xur@...gle.com>
Cc: "Maciej W. Rozycki" <macro@...am.me.uk>, Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Nick Desaulniers <ndesaulniers@...gle.com>, Klara Modin <klarasmodin@...il.com>,
linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] MIPS: move _stext definition to vmlinux.lds.S
On Thu, Nov 14, 2024 at 3:13 AM Rong Xu <xur@...gle.com> wrote:
>
> "
>
> On Wed, Nov 13, 2024 at 7:55 AM Maciej W. Rozycki <macro@...am.me.uk> wrote:
> >
> > On Tue, 12 Nov 2024, Rong Xu wrote:
> >
> > > The _stext symbol is intended to reference the start of the text section.
> > > However, it currently relies on a fragile link order because the existing
> > > EXPORT(_stext) resides within the .text section, which is not guaranteed
> > > to be placed first.
> >
> > Umm, arch/mips/kernel/head.S does mean to be linked first. We rely on it
> > for environments where there's no entry point is available and execution
> > starts from the beginning of the image. See the comment right below your
> > change.
> >
> When you said "arch/mips/kernel/head.S does mean to be linked first", is it
> a hard requirement in mips? This patch only moves _stext but leaves other
> symbols from heads.S for TEXT_TEXT macro to order. For example,
> __kernel_entry is placed in the middle of the text segment.
>
> If we want head.S to be linked first, I can change the patch to place
> all symbols from head.S before TEXT_TEXT.
No change is needed for this.
arch/mips/kernel/head.o is always passed to the linker first.
This is guaranteed by scripts/head-object-list.txt
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists