Skip to contentSkip to conversation

objtool: Let --hacks=jump_label read special sections with alts.

PATCH Applied Dylan Hatch 2 participants 2 messages Sep 23, 2025 – Oct 1, 2025 objtool

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 objtool: Let --hacks=jump_label read special sections with alts.

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 de6fbcedf5ab ("objtool: Read special sections with alts only when specific options are selected")
---
 tools/objtool/check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/objtool/check.c +1 -1
index d14f20ef1db1..1b4b4bd7dc90 100644
@@ -2562,7 +2562,7 @@ 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;
Signature · 1 line
2.51.0.534.gc79095c0ca-goog
maintainer Applied
#1 lore raw
Quoted 5 lines · Dylan Hatch

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.

Quoted 7 lines

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 de6fbcedf5ab ("objtool: Read special sections with alts only when specific options are selected")

Queued, thanks!

Signature · 1 line
Josh