Re: linux-next: build failure after merge of the ftrace tree

From: Mark-PK Tsai
Date: Tue Jun 15 2021 - 02:51:53 EST


>
> On Thu, 10 Jun 2021 10:26:39 +0200
> Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > On Thu, Jun 10, 2021 at 06:08:25PM +1000, Stephen Rothwell wrote:
> > > Hi all,
> > >
> > > After merging the ftrace tree, today's linux-next build (powerpc
> > > allyesconfig) failed like this:
> > >
> > > Cannot find symbol for section 255: .text.opal_int_set_mfrr.
> > > arch/powerpc/platforms/powernv/opal-call.o: failed
> > >
> > > and many more similar.
> > >
> > > Caused by commit
> > >
> > > 9e419de4c678 ("recordmcount: Correct st_shndx handling")
> >
> > Argh.. lemme try and reproduce :/
>
> I'll go and revert this patch, and wait for a new version from Peter.
>
> Hmm, crap, this is also sent to Linus. I'll stop that too.
>
> -- Steve

I found the the build fail is because PPC64 is big endian and this
patch use st_shndx directyly.

Here is the case which cause this problem:
recordmcount search symbol for txtndx = 255(0xff), but the
corresponding symbol has st_shndx = 0xff00(bit endian) which
equals SHN_LORESERVE, so the updated get_symindex() return 0.

I send the patch v2 to fix it.
https://lore.kernel.org/lkml/20210615064720.21950-1-mark-pk.tsai@xxxxxxxxxxxx/

Below is the test environment I used:
https://musl.cc/powerpc64-linux-musl-cross.tgz
make allyesconfig CROSS_COMPILE=powerpc64-linux-musl- ARCH=powerpc
make vmlinux CROSS_COMPILE=powerpc64-linux-musl- ARCH=powerpc