Skip to content

Commit de6fbce

Browse files
sathvika-vmpe
authored andcommitted
objtool: Read special sections with alts only when specific options are selected
Call add_special_section_alts() only when stackval or orc or uaccess or noinstr options are passed to objtool. Tested-by: Naveen N. Rao <[email protected]> Reviewed-by: Naveen N. Rao <[email protected]> Reviewed-by: Christophe Leroy <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Signed-off-by: Sathvika Vasireddy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 280981d commit de6fbce

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/objtool/check.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2392,9 +2392,11 @@ static int decode_sections(struct objtool_file *file)
23922392
* Must be before add_jump_destinations(), which depends on 'func'
23932393
* being set for alternatives, to enable proper sibling call detection.
23942394
*/
2395-
ret = add_special_section_alts(file);
2396-
if (ret)
2397-
return ret;
2395+
if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr) {
2396+
ret = add_special_section_alts(file);
2397+
if (ret)
2398+
return ret;
2399+
}
23982400

23992401
ret = add_jump_destinations(file);
24002402
if (ret)

0 commit comments

Comments
 (0)