Re: [PATCH] arch/powerpc: Remove .interp section in vmlinux

0 views
Skip to first unread message

Nathan Chancellor

unread,
Oct 14, 2025, 8:22:00 PM (2 days ago) Oct 14
to Vishal Chourasia, Christophe Leroy, ma...@linux.ibm.com, linuxp...@lists.ozlabs.org, linux-...@vger.kernel.org, clang-bu...@googlegroups.com, ll...@lists.linux.dev
Hi Vishal,

On Mon, Oct 13, 2025 at 12:57:00PM +0530, Vishal Chourasia wrote:
> On Mon, Oct 13, 2025 at 08:46:48AM +0200, Christophe Leroy wrote:
> > +CLANG ppl
> >
> > Hi,
> >
> > Le 13/10/2025 à 06:01, Vishal Chourasia a écrit :
> > > While debugging a ppc64le QEMU guest on an x86_64 host, I observed GDB crashes
> > > when attempting to attach to the remote target:
> > >
> > > (gdb) target remote :1234
> > >
> > > Investigation revealed that cross-compiling the Linux kernel for ppc64le on an
> > > x86_64 host using Clang produces a vmlinux binary containing an empty .interp
> > > section. This empty .interp section is responsible for the GDB crashes.
> >
> > Which version of CLANG is it ?
> (i) ❯ clang --version
> clang version 21.0.0git (https://github.com/llvm/llvm-project.git a80bccc6847be104948f46d313f03ac6b9ccb292)
>
> >
> > >
> > > This issue does not occur when:
> > > - Building for ppc64le target using GCC on x86_64 host
> > > - Building for ppc64le target using Clang on ppc64le host
> >
> > Is it the same CLANG version ?
> # clang --version
> clang version 22.0.0git (https://github.com/llvm/llvm-project.git 2f755c543ab357bd83235592fcee37fa391cdd9d)
>
> >
> > > - Building for ppc64le target using GCC on ppc64le host
> > >
> > > For details refer [1]
> > >
> > > [1] https://sourceware.org/bugzilla/show_bug.cgi?id=33481

In this bug report, you mention using LLVM=1. Does the issue happen if
you use GNU ld (ld.bfd) via LD (i.e., LD=powerpc64le-linux-gnu-ld or
equivalent) over ld.lld from LLVM=1? This sounds more likely to be a
linker difference rather than a compiler difference.

Cheers,
Nathan

Nathan Chancellor

unread,
Oct 15, 2025, 2:28:00 PM (12 hours ago) Oct 15
to Vishal Chourasia, Christophe Leroy, ma...@linux.ibm.com, linuxp...@lists.ozlabs.org, linux-...@vger.kernel.org, clang-bu...@googlegroups.com, ll...@lists.linux.dev
On Wed, Oct 15, 2025 at 09:07:54AM +0530, Vishal Chourasia wrote:
> Hello Nathan,
>
> On Tue, Oct 14, 2025 at 05:21:54PM -0700, Nathan Chancellor wrote:
> > In this bug report, you mention using LLVM=1. Does the issue happen if
> > you use GNU ld (ld.bfd) via LD (i.e., LD=powerpc64le-linux-gnu-ld or
> > equivalent) over ld.lld from LLVM=1? This sounds more likely to be a
> > linker difference rather than a compiler difference.
>
> Thank you for the insight.
>
> Yes, when using powerpc64le-linux-gnu-ld linker .interp section is not
> emitted.
>
> Command:
> $ make LLVM=1 ARCH=powerpc LD=powerpc64le-linux-gnu-ld -j 8 zImage
> $ llvm-readelf -p .comment vmlinux
>
> String dump of section '.comment':
> [ 0] clang version 22.0.0git (https://github.com/llvm/llvm-project.git 7314565281ec28b745502c3f429fd431e16673eb)
>
> $ llvm-readelf -p .interp vmlinux
> llvm-readelf: warning: 'vmlinux': could not find section '.interp'

Thanks for confirming. Does this fix the issue for you? It appears to
work for me.

Cheers,
Nathan

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index de6ee7d35cff..15850296c0a9 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -330,7 +330,6 @@ SECTIONS
}
.hash : AT(ADDR(.hash) - LOAD_OFFSET) { *(.hash) }
.gnu.hash : AT(ADDR(.gnu.hash) - LOAD_OFFSET) { *(.gnu.hash) }
- .interp : AT(ADDR(.interp) - LOAD_OFFSET) { *(.interp) }
.rela.dyn : AT(ADDR(.rela.dyn) - LOAD_OFFSET)
{
__rela_dyn_start = .;
Reply all
Reply to author
Forward
0 new messages