Commit be8374a5 authored by Dylan Hatch's avatar Dylan Hatch Committed by Josh Poimboeuf
Browse files

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: de6fbced ("objtool: Read special sections with alts only when specific options are selected")
Signed-off-by: default avatarDylan Hatch <dylanbhatch@google.com>
Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
parent ff5c0466
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2563,7 +2563,8 @@ static int decode_sections(struct objtool_file *file)
	 * Must be before add_jump_destinations(), which depends on 'func'
	 * being set for alternatives, to enable proper sibling call detection.
	 */
	if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr) {
	if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr ||
	    opts.hack_jump_label) {
		ret = add_special_section_alts(file);
		if (ret)
			return ret;