Skip to content

Commit be8374a

Browse files
dylanbhatchjpoimboe
authored andcommitted
objtool: Fix standalone --hacks=jump_label
The objtool command line 'objtool --hacks=jump_label foo.o' on its own should be expected to rewrite jump labels to NOPs. This means the add_special_section_alts() code path needs to run when only this option is provided. This is mainly relevant in certain debugging situations, but could potentially also fix kernel builds in which objtool is run with --hacks=jump_label but without --orc, --stackval, --uaccess, or --hacks=noinstr. Fixes: de6fbce ("objtool: Read special sections with alts only when specific options are selected") Signed-off-by: Dylan Hatch <dylanbhatch@google.com> Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
1 parent ff5c046 commit be8374a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/objtool/check.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,8 @@ static int decode_sections(struct objtool_file *file)
25632563
* Must be before add_jump_destinations(), which depends on 'func'
25642564
* being set for alternatives, to enable proper sibling call detection.
25652565
*/
2566-
if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr) {
2566+
if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr ||
2567+
opts.hack_jump_label) {
25672568
ret = add_special_section_alts(file);
25682569
if (ret)
25692570
return ret;

0 commit comments

Comments
 (0)