Skip to content

[LLD] Empty .interp section in vmlinux breaks GDB debugging on PowerPCΒ #163496

@vishalc-ibm

Description

@vishalc-ibm

Environment

  • Target: PowerPC
  • Host: X86
  • Build command: make LLVM=1 ARCH=powerpc -j $(nproc) vmlinux

Issue

LLD generates vmlinux with an empty .interp section, causing GDB to crash when connecting to QEMU:

gdb vmlinux
(gdb) target remote :1234  # crashes here
$ make LLVM=1 ARCH=powerpc  -j`nproc` vmlinux  # compiles fine
$ llvm-readelf -p .interp vmlinux
String dump of section '.interp':

Expected Behavior

The kernel should not have a .interp section. GNU ld does not emit this section:

$ make LLVM=1 ARCH=powerpc LD=powerpc64le-linux-gnu-ld -j 8 vmlinux  # compiles fine
$ llvm-readelf -p .interp vmlinux
llvm-readelf: warning: 'vmlinux': could not find section '.interp'

Impact

Breaks kernel debugging with QEMU+GDB for PowerPC builds using LLVM.

πŸ“Œ GDB Bugzilla
πŸ“Œ LKML Thread

Metadata

Metadata

Assignees

No one assigned

    Labels

    lld:ELFquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions