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
 
         * Must be before add_jump_destinations(), which depends on 'func'
         * being set for alternatives, to enable proper sibling call detection.
         */
-       ret = add_special_section_alts(file);
-       if (ret)
-               return ret;
+       if (opts.stackval || opts.orc || opts.uaccess || opts.noinstr) {
+               ret = add_special_section_alts(file);
+               if (ret)
+                       return ret;
+       }
 
        ret = add_jump_destinations(file);
        if (ret)