mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
Merge patch series "riscv: improve link and support ARCH_WANT_LD_ORPHAN_WARN"
Jisheng Zhang <jszhang@kernel.org> says: This series tries to improve link time handling of riscv: patch1 adds the missing RUNTIME_DISCARD_EXIT as suggested by Masahiro. Similar as other architectures such as x86, arm64 and so on, enable ARCH_WANT_LD_ORPHAN_WARN to enable linker orphan warnings to prevent from missing any new sections in future. So the following two patches are preparation ones, and the last patch finally selects ARCH_WANT_LD_ORPHAN_WARN * b4-shazam-merge: riscv: select ARCH_WANT_LD_ORPHAN_WARN for !XIP_KERNEL riscv: vmlinux.lds.S: explicitly catch .init.bss sections from EFI stub riscv: vmlinux.lds.S: explicitly catch .riscv.attributes sections riscv: vmlinux.lds.S: explicitly catch .rela.dyn symbols riscv: lds: define RUNTIME_DISCARD_EXIT Link: https://lore.kernel.org/r/20230119155417.2600-1-jszhang@kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
This commit is contained in:
commit
f3af3b0039
2 changed files with 10 additions and 0 deletions
|
@ -47,6 +47,7 @@ config RISCV
|
||||||
select ARCH_WANT_FRAME_POINTERS
|
select ARCH_WANT_FRAME_POINTERS
|
||||||
select ARCH_WANT_GENERAL_HUGETLB
|
select ARCH_WANT_GENERAL_HUGETLB
|
||||||
select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
|
select ARCH_WANT_HUGE_PMD_SHARE if 64BIT
|
||||||
|
select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
|
||||||
select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
|
select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
|
||||||
select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
|
select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
|
||||||
select BUILDTIME_TABLE_SORT if MMU
|
select BUILDTIME_TABLE_SORT if MMU
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define RO_EXCEPTION_TABLE_ALIGN 4
|
#define RO_EXCEPTION_TABLE_ALIGN 4
|
||||||
|
#define RUNTIME_DISCARD_EXIT
|
||||||
|
|
||||||
#ifdef CONFIG_XIP_KERNEL
|
#ifdef CONFIG_XIP_KERNEL
|
||||||
#include "vmlinux-xip.lds.S"
|
#include "vmlinux-xip.lds.S"
|
||||||
|
@ -86,6 +87,9 @@ SECTIONS
|
||||||
/* Start of init data section */
|
/* Start of init data section */
|
||||||
__init_data_begin = .;
|
__init_data_begin = .;
|
||||||
INIT_DATA_SECTION(16)
|
INIT_DATA_SECTION(16)
|
||||||
|
.init.bss : {
|
||||||
|
*(.init.bss) /* from the EFI stub */
|
||||||
|
}
|
||||||
.exit.data :
|
.exit.data :
|
||||||
{
|
{
|
||||||
EXIT_DATA
|
EXIT_DATA
|
||||||
|
@ -96,6 +100,10 @@ SECTIONS
|
||||||
*(.rel.dyn*)
|
*(.rel.dyn*)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.rela.dyn : {
|
||||||
|
*(.rela*)
|
||||||
|
}
|
||||||
|
|
||||||
__init_data_end = .;
|
__init_data_end = .;
|
||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
|
@ -141,6 +149,7 @@ SECTIONS
|
||||||
STABS_DEBUG
|
STABS_DEBUG
|
||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
ELF_DETAILS
|
ELF_DETAILS
|
||||||
|
.riscv.attributes 0 : { *(.riscv.attributes) }
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue