riscv: vmlinux.lds.S: explicitly catch .init.bss sections from EFI stub
authorJisheng Zhang <jszhang@kernel.org>
Thu, 19 Jan 2023 15:54:16 +0000 (23:54 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 22 Feb 2023 00:29:06 +0000 (16:29 -0800)
When enabling linker orphan section warning, I got warnings similar as
below:
ld.lld: warning:
./drivers/firmware/efi/libstub/lib.a(efi-stub-helper.stub.o):(.init.bss)
is being placed in '.init.bss'

Catch the sections so that we can enable linker orphan section warning.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Link: https://lore.kernel.org/r/20230119155417.2600-5-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/vmlinux.lds.S

index 7eb3d25d0daefc43d2bbcddfb68ab51e244deea8..b2813b5e47a0e4bab7a6cd485b070aa69bc2f16c 100644 (file)
@@ -87,6 +87,9 @@ SECTIONS
        /* Start of init data section */
        __init_data_begin = .;
        INIT_DATA_SECTION(16)
+       .init.bss : {
+               *(.init.bss)    /* from the EFI stub */
+       }
        .exit.data :
        {
                EXIT_DATA