powerpc/build: vdso linker warning for orphan sections

Add --orphan-handlin for vdsos, and adjust vdso linker scripts to deal
with orphan sections.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230609051002.3342-1-npiggin@gmail.com
This commit is contained in:
Nicholas Piggin 2023-06-09 15:10:02 +10:00 committed by Michael Ellerman
parent b4bda59b47
commit 8ad57add77
3 changed files with 8 additions and 2 deletions

View File

@ -56,6 +56,8 @@ KCSAN_SANITIZE := n
ccflags-y := -fno-common -fno-builtin
ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack
ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld)
ldflags-$(CONFIG_LD_ORPHAN_WARN) += -Wl,--orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL)
# Filter flags that clang will warn are unused for linking
ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER) $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CFLAGS))

View File

@ -83,9 +83,11 @@ SECTIONS
/DISCARD/ : {
*(.note.GNU-stack)
*(*.EMB.apuinfo)
*(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)
*(.got1)
*(.got1 .glink .iplt .rela*)
}
}

View File

@ -32,7 +32,7 @@ SECTIONS
. = ALIGN(16);
.text : {
*(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
*(.sfpr .glink)
*(.sfpr)
} :text
PROVIDE(__etext = .);
PROVIDE(_etext = .);
@ -81,10 +81,12 @@ SECTIONS
/DISCARD/ : {
*(.note.GNU-stack)
*(*.EMB.apuinfo)
*(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss)
*(.opd)
*(.glink .iplt .plt .rela*)
}
}