riscv: vmlinux.lds.S: explicitly catch .riscv.attributes sections
authorJisheng Zhang <jszhang@kernel.org>
Thu, 19 Jan 2023 15:54:15 +0000 (23:54 +0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Wed, 22 Feb 2023 00:29:05 +0000 (16:29 -0800)
When enabling linker orphan section warning, I got warnings similar as
below:
riscv64-linux-gnu-ld: warning: orphan section `.riscv.attributes' from
`init/main.o' being placed in section `.riscv.attributes'

While I don't see any usage of .riscv.attributes sections' in kernel
now, just 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-4-jszhang@kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/kernel/vmlinux.lds.S

index 6a250313b752815ed2f080d59de5df4f7bc56767..7eb3d25d0daefc43d2bbcddfb68ab51e244deea8 100644 (file)
@@ -146,6 +146,7 @@ SECTIONS
        STABS_DEBUG
        DWARF_DEBUG
        ELF_DETAILS
+       .riscv.attributes 0 : { *(.riscv.attributes) }
 
        DISCARDS
 }