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

Reply via email to