This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/81708] The x86 stack canary location should be customizable
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 09 Aug 2017 08:50:33 +0000
- Subject: [Bug target/81708] The x86 stack canary location should be customizable
- Auto-submitted: auto-generated
- References: <bug-81708-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81708
--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 41955
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41955&action=edit
patch that introduces mstack-protector-guard-symbol=
This patch can be used to override TLS offset with a symbol.
gcc.target/i386/stack-prot-guard.c compiles to (-O2 -fstack-protector-all
-mstack-protector-guard-symbol=symbol_name):
f:
subq $24, %rsp
movq %fs:symbol_name(%rip), %rax
movq %rax, 8(%rsp)
xorl %eax, %eax
movq 8(%rsp), %rax
xorq %fs:symbol_name(%rip), %rax
jne .L5
addq $24, %rsp
ret