diff options
Diffstat (limited to 'tools/objtool/warn.h')
| -rw-r--r-- | tools/objtool/warn.h | 22 | 
1 files changed, 9 insertions, 13 deletions
diff --git a/tools/objtool/warn.h b/tools/objtool/warn.h index afd9f7a05f6d..cbb0a02b7480 100644 --- a/tools/objtool/warn.h +++ b/tools/objtool/warn.h @@ -1,18 +1,6 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */  /*   * Copyright (C) 2015 Josh Poimboeuf <[email protected]> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see <http://www.gnu.org/licenses/>.   */  #ifndef _WARN_H @@ -64,6 +52,14 @@ static inline char *offstr(struct section *sec, unsigned long offset)  	free(_str);					\  }) +#define BT_FUNC(format, insn, ...)			\ +({							\ +	struct instruction *_insn = (insn);		\ +	char *_str = offstr(_insn->sec, _insn->offset); \ +	WARN("  %s: " format, _str, ##__VA_ARGS__);	\ +	free(_str);					\ +}) +  #define WARN_ELF(format, ...)				\  	WARN(format ": %s", ##__VA_ARGS__, elf_errmsg(-1))  |