linux/arch/powerpc
Michael Ellerman 07b050f929 powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds
Relocatable kernels must not discard relocations, they need to be
processed at runtime. As such they are included for CONFIG_RELOCATABLE
builds in the powerpc linker script (line 340).

However they are also unconditionally discarded later in the
script (line 414). Previously that worked because the earlier inclusion
superseded the discard.

However commit 99cb0d917f ("arch: fix broken BuildID for arm64 and
riscv") introduced an earlier use of DISCARD as part of the RO_DATA
macro (line 137). With binutils < 2.36 that causes the DISCARD
directives later in the script to be applied earlier, causing .rela* to
actually be discarded at link time, leading to build warnings and a
kernel that doesn't boot:

  ld: warning: discarding dynamic section .rela.init.rodata

Fix it by conditionally discarding .rela* only when CONFIG_RELOCATABLE
is disabled.

Fixes: 99cb0d917f ("arch: fix broken BuildID for arm64 and riscv")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Link: https://lore.kernel.org/r/20230105132349.384666-2-mpe@ellerman.id.au
2023-01-06 00:25:01 +11:00
..
boot powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
configs USB/Thunderbolt driver changes for 6.2-rc1 2022-12-16 03:22:53 -08:00
crypto treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
include powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
kernel powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds 2023-01-06 00:25:01 +11:00
kexec powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
kvm powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
lib powerpc/code-patching: Fix oops with DEBUG_VM enabled 2022-12-16 23:59:43 +11:00
math-emu powerpc/math-emu: Inhibit W=1 warnings 2022-09-08 11:11:18 +10:00
mm powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
net powerpc/bpf/32: Fix Oops on tail call tests 2022-11-24 23:05:10 +11:00
perf powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
platforms powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
purgatory powerpc/purgatory: Omit use of bin2c 2022-07-27 21:36:03 +10:00
sysdev powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
tools powerpc/64: Add UADDR64 relocation support 2022-03-09 21:47:53 +11:00
xmon powerpc: Rename STACK_FRAME_MARKER and derive it from frame offset 2022-12-02 17:54:08 +11:00
Kbuild
Kconfig Merge branch 'topic/objtool' into next 2022-12-08 23:57:47 +11:00
Kconfig.debug powerpc: Add support for early debugging via Serial 16550 console 2022-09-28 19:22:09 +10:00
Makefile Kbuild updates for v6.1 2022-10-10 12:00:45 -07:00
Makefile.postlink