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

Use the approach similar as ARM64 does and declare it in vmlinux.lds.S

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

index 07c19f2..6a25031 100644 (file)
@@ -97,6 +97,10 @@ SECTIONS
                *(.rel.dyn*)
        }
 
+       .rela.dyn : {
+               *(.rela*)
+       }
+
        __init_data_end = .;
 
        . = ALIGN(8);