Patch "powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     powerpc-vmlinux.lds-don-t-discard-.rela-for-relocatable-builds.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From stable-owner@xxxxxxxxxxxxxxx Thu Mar  2 03:04:28 2023
From: Tom Saeger <tom.saeger@xxxxxxxxxx>
Date: Wed,  1 Mar 2023 19:03:50 -0700
Subject: powerpc/vmlinux.lds: Don't discard .rela* for relocatable builds
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Sasha Levin <sashal@xxxxxxxxxx>, Tom Saeger <tom.saeger@xxxxxxxxxx>, stable@xxxxxxxxxxxxxxx, Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Message-ID: <20230210-tsaeger-upstream-linux-stable-5-15-v3-3-3431a425f0c7@xxxxxxxxxx>

From: Michael Ellerman <mpe@xxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxx>

Link: https://lore.kernel.org/r/20230105132349.384666-2-mpe@xxxxxxxxxxxxxx
Signed-off-by: Tom Saeger <tom.saeger@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 arch/powerpc/kernel/vmlinux.lds.S |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -408,9 +408,12 @@ SECTIONS
 	DISCARDS
 	/DISCARD/ : {
 		*(*.EMB.apuinfo)
-		*(.glink .iplt .plt .rela* .comment)
+		*(.glink .iplt .plt .comment)
 		*(.gnu.version*)
 		*(.gnu.attributes)
 		*(.eh_frame)
+#ifndef CONFIG_RELOCATABLE
+		*(.rela*)
+#endif
 	}
 }


Patches currently in stable-queue which might be from stable-owner@xxxxxxxxxxxxxxx are

queue-5.15/sched-fair-detect-capacity-inversion.patch
queue-5.15/powerpc-vmlinux.lds-don-t-discard-.rela-for-relocatable-builds.patch
queue-5.15/sched-uclamp-make-cpu_overutilized-use-util_fits_cpu.patch
queue-5.15/s390-define-runtime_discard_exit-to-fix-link-error-with-gnu-ld-2.36.patch
queue-5.15/powerpc-vmlinux.lds-define-runtime_discard_exit.patch
queue-5.15/sched-uclamp-fix-fits_capacity-check-in-feec.patch
queue-5.15/sched-fair-consider-capacity-inversion-in-util_fits_cpu.patch
queue-5.15/sched-fair-fixes-for-capacity-inversion-detection.patch
queue-5.15/sched-uclamp-fix-a-uninitialized-variable-warnings.patch
queue-5.15/arch-fix-broken-buildid-for-arm64-and-riscv.patch
queue-5.15/sched-uclamp-cater-for-uclamp-in-find_energy_efficient_cpu-s-early-exit-condition.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux