Skip to content

Commit

Permalink
powerpc/build: vdso linker warning for orphan sections
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Nicholas Piggin authored and Michael Ellerman committed Jun 15, 2023
1 parent b4bda59 commit 8ad57ad
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kernel/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/kernel/vdso/vdso32.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
}
}

Expand Down
4 changes: 3 additions & 1 deletion arch/powerpc/kernel/vdso/vdso64.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ SECTIONS
. = ALIGN(16);
.text : {
*(.text .stub .text.* .gnu.linkonce.t.* __ftr_alt_*)
*(.sfpr .glink)
*(.sfpr)
} :text
PROVIDE(__etext = .);
PROVIDE(_etext = .);
Expand Down Expand Up @@ -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*)
}
}

Expand Down

0 comments on commit 8ad57ad

Please sign in to comment.