linux-stable/arch
Nathan Chancellor 9abfb2c869 arm64: Handle .ARM.attributes section in linker scripts
commit ca0f4fe7cf upstream.

A recent LLVM commit [1] started generating an .ARM.attributes section
similar to the one that exists for 32-bit, which results in orphan
section warnings (or errors if CONFIG_WERROR is enabled) from the linker
because it is not handled in the arm64 linker scripts.

  ld.lld: error: arch/arm64/kernel/vdso/vgettimeofday.o:(.ARM.attributes) is being placed in '.ARM.attributes'
  ld.lld: error: arch/arm64/kernel/vdso/vgetrandom.o:(.ARM.attributes) is being placed in '.ARM.attributes'

  ld.lld: error: vmlinux.a(lib/vsprintf.o):(.ARM.attributes) is being placed in '.ARM.attributes'
  ld.lld: error: vmlinux.a(lib/win_minmax.o):(.ARM.attributes) is being placed in '.ARM.attributes'
  ld.lld: error: vmlinux.a(lib/xarray.o):(.ARM.attributes) is being placed in '.ARM.attributes'

Discard the new sections in the necessary linker scripts to resolve the
warnings, as the kernel and vDSO do not need to retain it, similar to
the .note.gnu.property section.

Cc: stable@vger.kernel.org
Fixes: b3e5d80d0c ("arm64/build: Warn on orphan section placement")
Link: ee99c4d484 [1]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20250206-arm64-handle-arm-attributes-in-linker-script-v3-1-d53d169913eb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-03-13 12:50:41 +01:00
..
alpha alpha: align stack for page fault and user unaligned trap handlers 2025-03-13 12:50:40 +01:00
arc
arm
arm64 arm64: Handle .ARM.attributes section in linker scripts 2025-03-13 12:50:41 +01:00
csky
h8300
hexagon hexagon: Fix unbalanced spinlock in die() 2025-03-13 12:50:14 +01:00
ia64
m68k m68k: vga: Fix I/O defines 2025-03-13 12:50:23 +01:00
microblaze
mips MIPS: ftrace: Declare ftrace_get_parent_ra_addr() as static 2025-03-13 12:50:33 +01:00
nds32
nios2
openrisc
parisc
powerpc powerpc/pseries/eeh: Fix get PE state translation 2025-03-13 12:50:28 +01:00
riscv
s390 KVM: s390: vsie: fix some corner-cases when grabbing vsie pages 2025-03-13 12:50:24 +01:00
sh
sparc
um
x86 perf/x86/intel: Ensure LBRs are disabled when a CPU is starting 2025-03-13 12:50:37 +01:00
xtensa
.gitignore
Kconfig