hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/objtool/warn.h
....@@ -1,18 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) 2015 Josh Poimboeuf <jpoimboe@redhat.com>
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version 2
7
- * of the License, or (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
164 */
175
186 #ifndef _WARN_H
....@@ -33,7 +21,7 @@
3321 char *name, *str;
3422 unsigned long name_off;
3523
36
- func = find_containing_func(sec, offset);
24
+ func = find_func_containing(sec, offset);
3725 if (func) {
3826 name = func->name;
3927 name_off = offset - func->offset;
....@@ -64,6 +52,14 @@
6452 free(_str); \
6553 })
6654
55
+#define BT_FUNC(format, insn, ...) \
56
+({ \
57
+ struct instruction *_insn = (insn); \
58
+ char *_str = offstr(_insn->sec, _insn->offset); \
59
+ WARN(" %s: " format, _str, ##__VA_ARGS__); \
60
+ free(_str); \
61
+})
62
+
6763 #define WARN_ELF(format, ...) \
6864 WARN(format ": %s", ##__VA_ARGS__, elf_errmsg(-1))
6965