Commit 8ad57add authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman

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: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230609051002.3342-1-npiggin@gmail.com
parent b4bda59b
...@@ -56,6 +56,8 @@ KCSAN_SANITIZE := n ...@@ -56,6 +56,8 @@ KCSAN_SANITIZE := n
ccflags-y := -fno-common -fno-builtin ccflags-y := -fno-common -fno-builtin
ldflags-y := -Wl,--hash-style=both -nostdlib -shared -z noexecstack 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_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 # 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)) ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER) $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CFLAGS))
......
...@@ -83,9 +83,11 @@ SECTIONS ...@@ -83,9 +83,11 @@ SECTIONS
/DISCARD/ : { /DISCARD/ : {
*(.note.GNU-stack) *(.note.GNU-stack)
*(*.EMB.apuinfo)
*(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*) *(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss) *(.bss .sbss .dynbss .dynsbss)
*(.got1) *(.got1 .glink .iplt .rela*)
} }
} }
......
...@@ -32,7 +32,7 @@ SECTIONS ...@@ -32,7 +32,7 @@ SECTIONS
. = ALIGN(16); . = ALIGN(16);
.text : { .text : {
*(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*) *(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
*(.sfpr .glink) *(.sfpr)
} :text } :text
PROVIDE(__etext = .); PROVIDE(__etext = .);
PROVIDE(_etext = .); PROVIDE(_etext = .);
...@@ -81,10 +81,12 @@ SECTIONS ...@@ -81,10 +81,12 @@ SECTIONS
/DISCARD/ : { /DISCARD/ : {
*(.note.GNU-stack) *(.note.GNU-stack)
*(*.EMB.apuinfo)
*(.branch_lt) *(.branch_lt)
*(.data .data.* .gnu.linkonce.d.* .sdata*) *(.data .data.* .gnu.linkonce.d.* .sdata*)
*(.bss .sbss .dynbss .dynsbss) *(.bss .sbss .dynbss .dynsbss)
*(.opd) *(.opd)
*(.glink .iplt .plt .rela*)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment