diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-16 13:29:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-05-16 13:29:00 -0400 |
commit | b2ca74d32bba153a1507e6b7e36d3ec8a89311a1 (patch) | |
tree | 7efc712ce6453a2a9a231bdaf858fbedd35a0c03 /tools/objtool | |
parent | 8c05f3b965da14e7790711026b32cc10a4c06213 (diff) | |
parent | 2decec48b0fd28ffdbf4cc684bd04e735f0839dd (diff) |
Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull core fixes from Ingo Molnar:
"A handful of objtool updates, plus a documentation addition for
__ab_c_size()"
* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
objtool: Fix whitelist documentation typo
objtool: Fix function fallthrough detection
objtool: Don't use ignore flag for fake jumps
overflow.h: Add comment documenting __ab_c_size()
Diffstat (limited to 'tools/objtool')
-rw-r--r-- | tools/objtool/Documentation/stack-validation.txt | 2 | ||||
-rw-r--r-- | tools/objtool/check.c | 11 |
2 files changed, 8 insertions, 5 deletions
diff --git a/tools/objtool/Documentation/stack-validation.txt b/tools/objtool/Documentation/stack-validation.txt index 8df526c80b65..4dd11a554b9b 100644 --- a/tools/objtool/Documentation/stack-validation.txt +++ b/tools/objtool/Documentation/stack-validation.txt | |||
@@ -306,7 +306,7 @@ ignore it: | |||
306 | 306 | ||
307 | - To skip validation of a file, add | 307 | - To skip validation of a file, add |
308 | 308 | ||
309 | OBJECT_FILES_NON_STANDARD_filename.o := n | 309 | OBJECT_FILES_NON_STANDARD_filename.o := y |
310 | 310 | ||
311 | to the Makefile. | 311 | to the Makefile. |
312 | 312 | ||
diff --git a/tools/objtool/check.c b/tools/objtool/check.c index ac743a1d53ab..7325d89ccad9 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <linux/hashtable.h> | 28 | #include <linux/hashtable.h> |
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | 30 | ||
31 | #define FAKE_JUMP_OFFSET -1 | ||
32 | |||
31 | struct alternative { | 33 | struct alternative { |
32 | struct list_head list; | 34 | struct list_head list; |
33 | struct instruction *insn; | 35 | struct instruction *insn; |
@@ -568,7 +570,7 @@ static int add_jump_destinations(struct objtool_file *file) | |||
568 | insn->type != INSN_JUMP_UNCONDITIONAL) | 570 | insn->type != INSN_JUMP_UNCONDITIONAL) |
569 | continue; | 571 | continue; |
570 | 572 | ||
571 | if (insn->ignore) | 573 | if (insn->ignore || insn->offset == FAKE_JUMP_OFFSET) |
572 | continue; | 574 | continue; |
573 | 575 | ||
574 | rela = find_rela_by_dest_range(insn->sec, insn->offset, | 576 | rela = find_rela_by_dest_range(insn->sec, insn->offset, |
@@ -745,10 +747,10 @@ static int handle_group_alt(struct objtool_file *file, | |||
745 | clear_insn_state(&fake_jump->state); | 747 | clear_insn_state(&fake_jump->state); |
746 | 748 | ||
747 | fake_jump->sec = special_alt->new_sec; | 749 | fake_jump->sec = special_alt->new_sec; |
748 | fake_jump->offset = -1; | 750 | fake_jump->offset = FAKE_JUMP_OFFSET; |
749 | fake_jump->type = INSN_JUMP_UNCONDITIONAL; | 751 | fake_jump->type = INSN_JUMP_UNCONDITIONAL; |
750 | fake_jump->jump_dest = list_next_entry(last_orig_insn, list); | 752 | fake_jump->jump_dest = list_next_entry(last_orig_insn, list); |
751 | fake_jump->ignore = true; | 753 | fake_jump->func = orig_insn->func; |
752 | } | 754 | } |
753 | 755 | ||
754 | if (!special_alt->new_len) { | 756 | if (!special_alt->new_len) { |
@@ -1957,7 +1959,8 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, | |||
1957 | return 1; | 1959 | return 1; |
1958 | } | 1960 | } |
1959 | 1961 | ||
1960 | func = insn->func ? insn->func->pfunc : NULL; | 1962 | if (insn->func) |
1963 | func = insn->func->pfunc; | ||
1961 | 1964 | ||
1962 | if (func && insn->ignore) { | 1965 | if (func && insn->ignore) { |
1963 | WARN_FUNC("BUG: why am I validating an ignored function?", | 1966 | WARN_FUNC("BUG: why am I validating an ignored function?", |