vmlinux.lds.h: Keep .ctors.* with .ctors
authorKees Cook <keescook@chromium.org>
Mon, 5 Oct 2020 02:57:20 +0000 (19:57 -0700)
committerKees Cook <keescook@chromium.org>
Tue, 27 Oct 2020 18:13:41 +0000 (11:13 -0700)
commit3e6631485fae70f474d5bd85cfaf0f113f61ccce
tree926ee0a90d438cc02f6a006fd22553a607c62f6c
parent3650b228f83adda7e5ee532e2b90429c03f7b9ec
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: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 83109d5d5fba ("x86/build: Warn on orphan section placement")
Signed-off-by: Kees Cook <keescook@chromium.org>
Acked-by: Nick Desaulniers <ndesaulniers@google.com>
Link: https://lore.kernel.org/r/20201005025720.2599682-1-keescook@chromium.org
include/asm-generic/vmlinux.lds.h