diff mbox series

[v4,12/16] objtool: Read special sections with alts only when specific options are selected

Message ID 20221002104240.1316480-13-sv@linux.ibm.com (mailing list archive)
State Changes Requested
Headers show
Series objtool: Enable and implement --mcount option on powerpc | expand

Commit Message

Sathvika Vasireddy Oct. 2, 2022, 10:42 a.m. UTC
Call add_special_section_alts() only when stackval or orc or uaccess or
noinstr options are passed to objtool.

Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>
---
 tools/objtool/check.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

Comments

Christophe Leroy Oct. 2, 2022, 5:42 p.m. UTC | #1
Le 02/10/2022 à 12:42, Sathvika Vasireddy a écrit :
> Call add_special_section_alts() only when stackval or orc or uaccess or
> noinstr options are passed to objtool.
> 
> Signed-off-by: Sathvika Vasireddy <sv@linux.ibm.com>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   tools/objtool/check.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/objtool/check.c b/tools/objtool/check.c
> index 35827e6c6df9..c6457dac6d58 100644
> --- a/tools/objtool/check.c
> +++ b/tools/objtool/check.c
> @@ -2372,9 +2372,11 @@ 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.
>   	 */
> -	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)
diff mbox series

Patch

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 35827e6c6df9..c6457dac6d58 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2372,9 +2372,11 @@  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.
 	 */
-	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)