Commit 3e663148 authored by Kees Cook's avatar Kees Cook

vmlinux.lds.h: Keep .ctors.* with .ctors

Under some circumstances, the compiler generates .ctors.* sections. This
is seen doing a cross compile of x86_64 from a powerpc64el host:

x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/trace_clock.o' being
placed in section `.ctors.65435'
x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ftrace.o' being
placed in section `.ctors.65435'
x86_64-linux-gnu-ld: warning: orphan section `.ctors.65435' from `kernel/trace/ring_buffer.o' being
placed in section `.ctors.65435'

Include these orphans along with the regular .ctors section.
Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Tested-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Fixes: 83109d5d ("x86/build: Warn on orphan section placement")
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20201005025720.2599682-1-keescook@chromium.org
parent 3650b228
...@@ -701,6 +701,7 @@ ...@@ -701,6 +701,7 @@
#ifdef CONFIG_CONSTRUCTORS #ifdef CONFIG_CONSTRUCTORS
#define KERNEL_CTORS() . = ALIGN(8); \ #define KERNEL_CTORS() . = ALIGN(8); \
__ctors_start = .; \ __ctors_start = .; \
KEEP(*(SORT(.ctors.*))) \
KEEP(*(.ctors)) \ KEEP(*(.ctors)) \
KEEP(*(SORT(.init_array.*))) \ KEEP(*(SORT(.init_array.*))) \
KEEP(*(.init_array)) \ KEEP(*(.init_array)) \
......
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