diff options
author | Richard Henderson <rth@redhat.com> | 2011-11-09 10:09:53 -0800 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2011-11-09 10:09:53 -0800 |
commit | 4bdd090f8e0becf7191967e920aa1c9f9b796d1b (patch) | |
tree | 2be51ac0c0d2ab8042b16a9225e4d4826aac0051 /libitm/config | |
parent | 29d281ca3a5cd40890ed826c6c6b8efe65ca266d (diff) | |
download | gcc-4bdd090f8e0becf7191967e920aa1c9f9b796d1b.zip gcc-4bdd090f8e0becf7191967e920aa1c9f9b796d1b.tar.gz gcc-4bdd090f8e0becf7191967e920aa1c9f9b796d1b.tar.bz2 |
libitm: Configure for gas cfi pseudo ops.
* asmcfi.m4: New file.
* configure.ac (GCC_AS_CFI_PSEUDO_OP): Test it.
* configure, aclocal.m4, config.h.in: Rebuild.
* config/generic/asmcfi.h: New file.
* config/x86/sjlj.S: Use it.
From-SVN: r181224
Diffstat (limited to 'libitm/config')
-rw-r--r-- | libitm/config/generic/asmcfi.h | 44 | ||||
-rw-r--r-- | libitm/config/x86/sjlj.S | 27 |
2 files changed, 59 insertions, 12 deletions
diff --git a/libitm/config/generic/asmcfi.h b/libitm/config/generic/asmcfi.h new file mode 100644 index 0000000..fcb45c5 --- /dev/null +++ b/libitm/config/generic/asmcfi.h @@ -0,0 +1,44 @@ + +/* Copyright (C) 2011 Free Software Foundation, Inc. + Contributed by Richard Henderson <rth@redhat.com>. + + This file is part of the GNU Transactional Memory Library (libitm). + + Libitm is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Libitm is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + Under Section 7 of GPL version 3, you are granted additional + permissions described in the GCC Runtime Library Exception, version + 3.1, as published by the Free Software Foundation. + + You should have received a copy of the GNU General Public License and + a copy of the GCC Runtime Library Exception along with this program; + see the files COPYING3 and COPYING.RUNTIME respectively. If not, see + <http://www.gnu.org/licenses/>. */ + +#include "config.h" + +#ifdef HAVE_AS_CFI_PSEUDO_OP + +#define cfi_startproc .cfi_startproc +#define cfi_endproc .cfi_endproc +#define cfi_def_cfa_offset(n) .cfi_def_cfa_offset n +#define cfi_def_cfa(r,n) .cfi_def_cfa r, n +#define cfi_register(o,n) .cfi_register o, n + +#else + +#define cfi_startproc +#define cfi_endproc +#define cfi_def_cfa_offset(n) +#define cfi_def_cfa(r,n) +#define cfi_register(o,n) + +#endif /* HAVE_ASM_CFI */ diff --git a/libitm/config/x86/sjlj.S b/libitm/config/x86/sjlj.S index 725ffec..6169499 100644 --- a/libitm/config/x86/sjlj.S +++ b/libitm/config/x86/sjlj.S @@ -22,18 +22,21 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see <http://www.gnu.org/licenses/>. */ + +#include "asmcfi.h" + .text .p2align 4 .globl _ITM_beginTransaction .type _ITM_beginTransaction, @function _ITM_beginTransaction: - .cfi_startproc + cfi_startproc #ifdef __x86_64__ leaq 8(%rsp), %rax movq (%rsp), %r8 subq $72, %rsp - .cfi_def_cfa_offset 80 + cfi_def_cfa_offset(80) movq %rax, (%rsp) movq %r8, 8(%rsp) movq %rbx, 16(%rsp) @@ -45,12 +48,12 @@ _ITM_beginTransaction: movq %rsp, %rsi call GTM_begin_transaction addq $72, %rsp - .cfi_def_cfa_offset 8 + cfi_def_cfa_offset(8) ret #else leal 4(%esp), %ecx subl $28, %esp - .cfi_def_cfa_offset 32 + cfi_def_cfa_offset(32) movl %ecx, 8(%esp) movl %ebx, 12(%esp) movl %esi, 16(%esp) @@ -59,10 +62,10 @@ _ITM_beginTransaction: leal 8(%esp), %edx call GTM_begin_transaction addl $28, %esp - .cfi_def_cfa_offset 4 + cfi_def_cfa_offset(4) ret #endif - .cfi_endproc + cfi_endproc .size _ITM_beginTransaction, .-_ITM_beginTransaction .p2align 4 @@ -71,7 +74,7 @@ _ITM_beginTransaction: .hidden GTM_longjmp GTM_longjmp: - .cfi_startproc + cfi_startproc #ifdef __x86_64__ movq (%rdi), %rcx movq 8(%rdi), %rdx @@ -82,8 +85,8 @@ GTM_longjmp: movq 48(%rdi), %r14 movq 56(%rdi), %r15 movl %esi, %eax - .cfi_def_cfa %rcx, 0 - .cfi_register %rip, %rdx + cfi_def_cfa(%rcx, 0) + cfi_register(%rip, %rdx) movq %rcx, %rsp jmp *%rdx #else @@ -94,12 +97,12 @@ GTM_longjmp: movl 12(%edx), %edi movl 16(%edx), %ebp movl 20(%edx), %edx - .cfi_def_cfa %ecx, 0 - .cfi_register %eip, %edx + cfi_def_cfa(%ecx, 0) + cfi_register(%eip, %edx) movl %ecx, %esp jmp *%edx #endif - .cfi_endproc + cfi_endproc .size GTM_longjmp, .-GTM_longjmp .section .note.GNU-stack, "", @progbits |