History

Merge tag 'objtool_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull objtool fix from Borislav Petkov: - Add a ORC format hash to vmlinux and modules in order for other tools which use it, to detect changes to it and adapt accordingly * tag 'objtool_urgent_for_v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/unwind/orc: Add ELF section with ORC version identifier

Linus Torvalds committed 3 years ago

Commit 300edd72 parents 661e723 b9f174c7 files · +59 −0Browse files

Showing the changes to scripts (2 of 7 files). Show all

Unified · Split

2 files
  1. scripts/mod/modpost.c +5 −0
  2. scripts/orc_hash.sh +16 −0
scripts/mod/modpost.c+5−0
@@ -1979,6 +1979,11 @@ static void add_header(struct buffer *b, struct module *mod) · 1978 unmodified lines
19791979 buf_printf(b, "#include <linux/vermagic.h>\n");
19801980 buf_printf(b, "#include <linux/compiler.h>\n");
19811981 buf_printf(b, "\n");
1982+ buf_printf(b, "#ifdef CONFIG_UNWINDER_ORC\n");
1983+ buf_printf(b, "#include <asm/orc_header.h>\n");
1984+ buf_printf(b, "ORC_HEADER;\n");
1985+ buf_printf(b, "#endif\n");
1986+ buf_printf(b, "\n");
19821987 buf_printf(b, "BUILD_SALT;\n");
19831988 buf_printf(b, "BUILD_LTO_INFO;\n");
19841989 buf_printf(b, "\n");
scripts/orc_hash.sh+16−0
@@ -0,0 +1,16 @@
1+#!/bin/sh
2+# SPDX-License-Identifier: GPL-2.0-or-later
3+# Copyright (c) Meta Platforms, Inc. and affiliates.
4+
5+set -e
6+
7+printf '%s' '#define ORC_HASH '
8+
9+awk '
10+/^#define ORC_(REG|TYPE)_/ { print }
11+/^struct orc_entry {$/ { p=1 }
12+p { print }
13+/^}/ { p=0 }' |
14+ sha1sum |
15+ cut -d " " -f 1 |
16+ sed 's/\([0-9a-f]\{2\}\)/0x\1,/g'