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
Showing the changes to scripts (2 of 7 files). Show all
Unified · Split
| @@ -1979,6 +1979,11 @@ static void add_header(struct buffer *b, struct module *mod) · 1978 unmodified lines | ||
| 1979 | 1979 | buf_printf(b, "#include <linux/vermagic.h>\n"); |
| 1980 | 1980 | buf_printf(b, "#include <linux/compiler.h>\n"); |
| 1981 | 1981 | 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"); | |
| 1982 | 1987 | buf_printf(b, "BUILD_SALT;\n"); |
| 1983 | 1988 | buf_printf(b, "BUILD_LTO_INFO;\n"); |
| 1984 | 1989 | buf_printf(b, "\n"); |
| @@ -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' | |