[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-dfcb8dae5d28b7cf259b367ed9ccbc1296284e0d@git.kernel.org>
Date: Tue, 30 Jan 2018 00:47:35 -0800
From: tip-bot for Josh Poimboeuf <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux@...ck-us.net, jgross@...e.com, hpa@...or.com,
peterz@...radead.org, dwmw2@...radead.org,
gregkh@...uxfoundation.org, torvalds@...ux-foundation.org,
jpoimboe@...hat.com, tglx@...utronix.de, bp@...en8.de,
luto@...nel.org, linux-kernel@...r.kernel.org, mingo@...nel.org,
dave.hansen@...ux.intel.com
Subject: [tip:x86/pti] objtool: Don't print '.tmp_' prefix for .o files when
CONFIG_MODVERSIONS=y
Commit-ID: dfcb8dae5d28b7cf259b367ed9ccbc1296284e0d
Gitweb: https://git.kernel.org/tip/dfcb8dae5d28b7cf259b367ed9ccbc1296284e0d
Author: Josh Poimboeuf <jpoimboe@...hat.com>
AuthorDate: Mon, 29 Jan 2018 22:00:42 -0600
Committer: Ingo Molnar <mingo@...nel.org>
CommitDate: Tue, 30 Jan 2018 07:55:05 +0100
objtool: Don't print '.tmp_' prefix for .o files when CONFIG_MODVERSIONS=y
With the following commit:
2a0098d70640 ("objtool: Fix seg fault with gold linker")
... objtool warnings started showing the modversions '.tmp_' prefix in
the .o file name, like:
arch/x86/mm/.tmp_mem_encrypt_boot.o: warning: objtool: sme_encrypt_execute()+0x48: indirect call found in RETPOLINE build
The prefix is confusing. Remove it from the printed 'objname' variable.
Signed-off-by: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Dave Hansen <dave.hansen@...ux.intel.com>
Cc: David Woodhouse <dwmw2@...radead.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Juergen Gross <jgross@...e.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Fixes: 2a0098d70640 ("objtool: Fix seg fault with gold linker")
Link: http://lkml.kernel.org/r/3788b5aec1c279184b78cdbd8b520903c0fb8a80.1517284349.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
tools/objtool/check.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 9cd028a..d45ab4d 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1978,6 +1978,25 @@ static void cleanup(struct objtool_file *file)
elf_close(file->elf);
}
+/*
+ * With CONFIG_MODVERSIONS=y, the object name has '.tmp_' prepended to it.
+ * After the file has been opened, remove the prefix so warnings will look
+ * sensible.
+ */
+static void fix_objname(void)
+{
+ char *s;
+
+ s = strstr(objname, ".tmp_");
+ if (!s)
+ return;
+
+ for (; s[5]; s++)
+ s[0] = s[5];
+
+ s[0] = 0;
+}
+
int check(const char *_objname, bool _no_fp, bool no_unreachable, bool orc)
{
struct objtool_file file;
@@ -1990,6 +2009,8 @@ int check(const char *_objname, bool _no_fp, bool no_unreachable, bool orc)
if (!file.elf)
return 1;
+ fix_objname();
+
INIT_LIST_HEAD(&file.insn_list);
hash_init(file.insn_hash);
file.whitelist = find_section_by_name(file.elf, ".discard.func_stack_frame_non_standard");
Powered by blists - more mailing lists