Skip to content

Commit c93db68

Browse files
mkubecekmasahir0y
authored andcommitted
kbuild: dummy-tools: adjust to stricter stackprotector check
Commit 3fb0fdb ("x86/stackprotector/32: Make the canary into a regular percpu variable") modified the stackprotector check on 32-bit x86 to check if gcc supports using %fs as canary. Adjust dummy-tools gcc script to pass this new test by returning "%fs" rather than "%gs" if it detects -mstack-protector-guard-reg=fs on command line. Fixes: 3fb0fdb ("x86/stackprotector/32: Make the canary into a regular percpu variable") Signed-off-by: Michal Kubecek <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 98a499a commit c93db68

File tree

1 file changed

+5
-1
lines changed
  • scripts/dummy-tools

1 file changed

+5
-1
lines changed

scripts/dummy-tools/gcc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ fi
7676
if arg_contain -S "$@"; then
7777
# For scripts/gcc-x86-*-has-stack-protector.sh
7878
if arg_contain -fstack-protector "$@"; then
79-
echo "%gs"
79+
if arg_contain -mstack-protector-guard-reg=fs "$@"; then
80+
echo "%fs"
81+
else
82+
echo "%gs"
83+
fi
8084
exit 0
8185
fi
8286

0 commit comments

Comments
 (0)