android_kernel_xiaomi_sm8450/arch/powerpc
Michael Ellerman 6af633e778 powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds
commit 07b050f9290ee012a407a0f64151db902a1520f5 upstream.

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 99cb0d917ffa ("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: 99cb0d917ffa ("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
Signed-off-by: Tom Saeger <tom.saeger@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-03-17 08:45:16 +01:00
..
boot powerpc: dts: t1040rdb: fix compatible string for Rev A boards 2023-03-17 08:45:10 +01:00
configs powerpc/config: Renable MTD_PHYSMAP_OF 2021-09-18 13:40:14 +02:00
crypto crypto: powerpc/crc-vpmsum_test - Fix sparse endianness warning 2020-09-04 17:57:15 +10:00
include powerpc/imc-pmu: Fix use of mutex in IRQs disabled section 2023-01-18 11:44:58 +01:00
kernel powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds 2023-03-17 08:45:16 +01:00
kexec powerpc: Set crashkernel offset to mid of RMA region 2022-04-13 21:00:56 +02:00
kvm KVM: PPC: Tick accounting should defer vtime accounting 'til after IRQ handling 2022-09-23 14:16:55 +02:00
lib powerpc/lib/sstep: Fix build errors with newer binutils 2022-04-08 14:40:36 +02:00
math-emu powerpc/math_emu/efp: Include module.h 2022-10-26 13:25:40 +02:00
mm powerpc/mm: Rearrange if-else block to avoid clang warning 2023-03-11 16:39:10 +01:00
net powerpc64/bpf: Limit 'ldbrx' to processors compliant with ISA v2.06 2022-02-01 17:25:45 +01:00
oprofile powerpc/oprofile: fix spelling mistake "contex" -> "context" 2020-08-25 01:31:33 +10:00
perf powerpc/perf/hv-24x7: add missing RTAS retry status handling 2023-03-11 16:39:44 +01:00
platforms powerpc/pseries/lparcfg: add missing RTAS retry status handling 2023-03-11 16:39:44 +01:00
purgatory powerpc/kexec_file: Enable early kernel OPAL calls 2020-07-29 23:47:55 +10:00
sysdev powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data() 2023-01-14 10:16:06 +01:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc/xmon: Fix -Wswitch-unreachable warning in bpt_cmds 2023-01-14 10:16:06 +01:00
Kbuild powerpc/kexec: Move kexec files into a dedicated subdir. 2019-11-21 15:41:34 +11:00
Kconfig powerpc/kasan: Force thread size increase with KASAN 2022-06-14 18:32:39 +02:00
Kconfig.debug powerpc: iommu: fix build when neither PCI or IBMVIO is set 2021-05-14 09:50:34 +02:00
Makefile powerpc: Remove linker flag from KBUILD_AFLAGS 2023-03-11 16:39:46 +01:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00