File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -369,6 +369,11 @@ config STACK_VALIDATION
369
369
For more information, see
370
370
tools/objtool/Documentation/stack-validation.txt.
371
371
372
+ config VMLINUX_VALIDATION
373
+ bool
374
+ depends on STACK_VALIDATION && DEBUG_ENTRY && !PARAVIRT
375
+ default y
376
+
372
377
config DEBUG_FORCE_WEAK_PER_CPU
373
378
bool "Force weak per-cpu definitions"
374
379
depends on DEBUG_KERNEL
Original file line number Diff line number Diff line change @@ -55,6 +55,29 @@ modpost_link()
55
55
${LD} ${KBUILD_LDFLAGS} -r -o ${1} ${objects}
56
56
}
57
57
58
+ objtool_link ()
59
+ {
60
+ local objtoolopt;
61
+
62
+ if [ -n " ${CONFIG_VMLINUX_VALIDATION} " ]; then
63
+ objtoolopt=" check"
64
+ if [ -z " ${CONFIG_FRAME_POINTER} " ]; then
65
+ objtoolopt=" ${objtoolopt} --no-fp"
66
+ fi
67
+ if [ -n " ${CONFIG_GCOV_KERNEL} " ]; then
68
+ objtoolopt=" ${objtoolopt} --no-unreachable"
69
+ fi
70
+ if [ -n " ${CONFIG_RETPOLINE} " ]; then
71
+ objtoolopt=" ${objtoolopt} --retpoline"
72
+ fi
73
+ if [ -n " ${CONFIG_X86_SMAP} " ]; then
74
+ objtoolopt=" ${objtoolopt} --uaccess"
75
+ fi
76
+ info OBJTOOL ${1}
77
+ tools/objtool/objtool ${objtoolopt} ${1}
78
+ fi
79
+ }
80
+
58
81
# Link of vmlinux
59
82
# ${1} - output file
60
83
# ${2}, ${3}, ... - optional extra .o files
@@ -251,6 +274,7 @@ ${MAKE} -f "${srctree}/scripts/Makefile.build" obj=init need-builtin=1
251
274
# link vmlinux.o
252
275
info LD vmlinux.o
253
276
modpost_link vmlinux.o
277
+ objtool_link vmlinux.o
254
278
255
279
# modpost vmlinux.o to check for section mismatches
256
280
${MAKE} -f " ${srctree} /scripts/Makefile.modpost" MODPOST_VMLINUX=1
You can’t perform that action at this time.
0 commit comments