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 <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Acked-by: Josh Poimboeuf <jpoimboe@kernel.org> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20221114175754.1131267-13-sv@linux.ibm.com
1 parent 280981d commit de6fbce

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

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)