This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/81708] The x86 stack canary location should be customizable


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]