FROMLIST: objtool: Don't autodetect vmlinux.o
With LTO, we run objtool on vmlinux.o, but don't want noinstr validation. This change requires --vmlinux to be passed to objtool explicitly. Bug: 145210207 Change-Id: Ibfd814126df6b3d1a52f5461f2e5aac1377b02c9 Link: https://lore.kernel.org/lkml/20201013003203.4168817-4-samitolvanen@google.com/ Suggested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Reviewed-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
@@ -106,7 +106,7 @@ objtool_link()
|
|||||||
local objtoolopt;
|
local objtoolopt;
|
||||||
|
|
||||||
if [ -n "${CONFIG_VMLINUX_VALIDATION}" ]; then
|
if [ -n "${CONFIG_VMLINUX_VALIDATION}" ]; then
|
||||||
objtoolopt="check"
|
objtoolopt="check --vmlinux"
|
||||||
if [ -z "${CONFIG_FRAME_POINTER}" ]; then
|
if [ -z "${CONFIG_FRAME_POINTER}" ]; then
|
||||||
objtoolopt="${objtoolopt} --no-fp"
|
objtoolopt="${objtoolopt} --no-fp"
|
||||||
fi
|
fi
|
||||||
|
@@ -41,7 +41,7 @@ const struct option check_options[] = {
|
|||||||
|
|
||||||
int cmd_check(int argc, const char **argv)
|
int cmd_check(int argc, const char **argv)
|
||||||
{
|
{
|
||||||
const char *objname, *s;
|
const char *objname;
|
||||||
struct objtool_file *file;
|
struct objtool_file *file;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -52,10 +52,6 @@ int cmd_check(int argc, const char **argv)
|
|||||||
|
|
||||||
objname = argv[0];
|
objname = argv[0];
|
||||||
|
|
||||||
s = strstr(objname, "vmlinux.o");
|
|
||||||
if (s && !s[9])
|
|
||||||
vmlinux = true;
|
|
||||||
|
|
||||||
file = objtool_open_read(objname);
|
file = objtool_open_read(objname);
|
||||||
if (!file)
|
if (!file)
|
||||||
return 1;
|
return 1;
|
||||||
|
Reference in New Issue
Block a user