powerpc/32: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly
PATCH 1/1 powerpc/32: Add .data..Lubsan_data*/.data..Lubsan_type* sections explicitly
When both CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y and CONFIG_UBSAN=y are set, link step typically produce numberous warnings about orphan section:
+ powerpc-linux-gnu-ld -EB -m elf32ppc -Bstatic --orphan-handling=warn --build-id --gc-sections -X -o .tmp_vmlinux1 -T ./arch/powerpc/kernel/vmlinux.lds --who le-archive built-in.a --no-whole-archive --start-group lib/lib.a --end-group
powerpc-linux-gnu-ld: warning: orphan section .data..Lubsan_data393' from init/main.o' being placed in section `.data..Lubsan_data393'.
powerpc-linux-gnu-ld: warning: orphan section .data..Lubsan_data394' from init/main.o' being placed in section `.data..Lubsan_data394'.
...
powerpc-linux-gnu-ld: warning: orphan section .data..Lubsan_type11' from init/main.o' being placed in section `.data..Lubsan_type11'.
powerpc-linux-gnu-ld: warning: orphan section .data..Lubsan_type12' from init/main.o' being placed in section `.data..Lubsan_type12'.
...
This commit remove those warnings produced at W=1.
--- arch/powerpc/kernel/vmlinux.lds.S | 4 ++++ 1 file changed, 4 insertions(+)
arch/powerpc/kernel/vmlinux.lds.S +4 -0
@@ -308,6 +308,10 @@ SECTIONS #ifdef CONFIG_PPC32 .data : AT(ADDR(.data) - LOAD_OFFSET) { DATA_DATA +#ifdef CONFIG_UBSAN + *(.data..Lubsan_data*) + *(.data..Lubsan_type*) +#endif *(.data.rel*) *(SDATA_MAIN) *(.sdata2)
Signature · 1 line
2.11.0
Michael Ellerman
AppliedQuoted 13 lines · Mathieu Malaterre
When both
CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=yandCONFIG_UBSAN=yare set, link step typically produce numberous warnings about orphan section:+ powerpc-linux-gnu-ld -EB -m elf32ppc -Bstatic --orphan-handling=warn --build-id --gc-sections -X -o .tmp_vmlinux1 -T
./arch/powerpc/kernel/vmlinux.lds--who le-archive built-in.a --no-whole-archive --start-grouplib/lib.a--end-group
powerpc-linux-gnu-ld: warning: orphan section.data..Lubsan_data393' frominit/main.o' being placed in section `.data..Lubsan_data393'.
powerpc-linux-gnu-ld: warning: orphan section.data..Lubsan_data394' frominit/main.o' being placed in section `.data..Lubsan_data394'.
...
powerpc-linux-gnu-ld: warning: orphan section.data..Lubsan_type11' frominit/main.o' being placed in section `.data..Lubsan_type11'.
powerpc-linux-gnu-ld: warning: orphan section.data..Lubsan_type12' frominit/main.o' being placed in section `.data..Lubsan_type12'.
...
Quoted 5 lines
This commit remove those warnings produced at W=1.
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/beba24ac59133cb36ecd03f9af9ccb
cheers