Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Sathvika Vasireddy and committed by
Michael Ellerman
de6fbced 280981d6

+5 -3
+5 -3
tools/objtool/check.c
··· 2392 2392 * Must be before add_jump_destinations(), which depends on 'func' 2393 2393 * being set for alternatives, to enable proper sibling call detection. 2394 2394 */ 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 + } 2398 2400 2399 2401 ret = add_jump_destinations(file); 2400 2402 if (ret)