diff options
Diffstat (limited to 'libgcc/config')
-rw-r--r-- | libgcc/config/arm/t-vxworks7 | 1 | ||||
-rw-r--r-- | libgcc/config/arm/unwind-arm-vxworks.c | 33 | ||||
-rw-r--r-- | libgcc/config/i386/i386-asm.h | 89 | ||||
-rw-r--r-- | libgcc/config/i386/resms64.S | 2 | ||||
-rw-r--r-- | libgcc/config/i386/resms64f.S | 2 | ||||
-rw-r--r-- | libgcc/config/i386/resms64fx.S | 2 | ||||
-rw-r--r-- | libgcc/config/i386/resms64x.S | 2 | ||||
-rw-r--r-- | libgcc/config/i386/savms64.S | 2 | ||||
-rw-r--r-- | libgcc/config/i386/savms64f.S | 2 | ||||
-rw-r--r-- | libgcc/config/rs6000/ibm-ldouble.c | 3 | ||||
-rw-r--r-- | libgcc/config/t-vxworks | 11 | ||||
-rw-r--r-- | libgcc/config/t-vxworks7 | 9 |
12 files changed, 108 insertions, 50 deletions
diff --git a/libgcc/config/arm/t-vxworks7 b/libgcc/config/arm/t-vxworks7 new file mode 100644 index 00000000000..bead3369a59 --- /dev/null +++ b/libgcc/config/arm/t-vxworks7 @@ -0,0 +1 @@ +LIB2ADDEH += $(srcdir)/config/arm/unwind-arm-vxworks.c diff --git a/libgcc/config/arm/unwind-arm-vxworks.c b/libgcc/config/arm/unwind-arm-vxworks.c new file mode 100644 index 00000000000..ed23ab9fc3c --- /dev/null +++ b/libgcc/config/arm/unwind-arm-vxworks.c @@ -0,0 +1,33 @@ +/* Support for ARM EABI unwinding in VxWorks Downloadable Kernel Modules. + Copyright (C) 2017 Free Software Foundation, Inc. + + This file 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, or (at your option) any + later version. + + This file 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/>. */ + +#if defined(__vxworks) && !defined (__RTP__) +/* Vxworks for ARM uses __gnu_Unwind_Find_exidx to retrieve the exception + table for downloadable kernel modules. As those modules are only partially + linked, the linker won't generate __exidx_start|end, but the two symbols + are still used in alternate paths from unwind-arm-common.inc. + + As we don't rely on them, but still need the symbols, we define dummy + values here. */ +void *__exidx_start __attribute__((__visibility__ ("hidden"))); +void *__exidx_end __attribute__((__visibility__ ("hidden"))); +#endif diff --git a/libgcc/config/i386/i386-asm.h b/libgcc/config/i386/i386-asm.h index c613e9fd83d..1387fd24b4f 100644 --- a/libgcc/config/i386/i386-asm.h +++ b/libgcc/config/i386/i386-asm.h @@ -26,22 +26,45 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #ifndef I386_ASM_H #define I386_ASM_H +#include "auto-host.h" + +/* These macros currently support GNU/Linux, Solaris and Darwin. */ + #ifdef __ELF__ -# define ELFFN(fn) .type fn,@function +# define FN_TYPE(fn) .type fn,@function +# define FN_SIZE(fn) .size fn,.-fn +# ifdef HAVE_GAS_HIDDEN +# define FN_HIDDEN(fn) .hidden fn +# endif +#else +# define FN_TYPE(fn) +# define FN_SIZE(fn) +#endif + +#ifndef FN_HIDDEN +# define FN_HIDDEN(fn) +#endif + +#ifdef __USER_LABEL_PREFIX__ +# define ASMNAME2(prefix, name) prefix ## name +# define ASMNAME1(prefix, name) ASMNAME2(prefix, name) +# define ASMNAME(name) ASMNAME1(__USER_LABEL_PREFIX__, name) #else -# define ELFFN(fn) +# define ASMNAME(name) name #endif -#define FUNC_START(fn) \ - .global fn; \ - ELFFN (fn); \ -fn: +#define FUNC_BEGIN(fn) \ + .globl ASMNAME(fn); \ + FN_TYPE (ASMNAME(fn)); \ +ASMNAME(fn): -#define HIDDEN_FUNC(fn)\ - FUNC_START (fn) \ - .hidden fn; \ +#define HIDDEN_FUNC(fn) \ + .globl ASMNAME(fn); \ + FN_TYPE(ASMNAME(fn)); \ + FN_HIDDEN(ASMNAME(fn)); \ +ASMNAME(fn): -#define FUNC_END(fn) .size fn,.-fn +#define FUNC_END(fn) FN_SIZE(ASMNAME(fn)) #ifdef __SSE2__ # ifdef __AVX__ @@ -51,32 +74,30 @@ fn: # endif /* Save SSE registers 6-15. off is the offset of rax to get to xmm6. */ -.macro SSE_SAVE off=0 - MOVAPS %xmm15,(\off - 0x90)(%rax) - MOVAPS %xmm14,(\off - 0x80)(%rax) - MOVAPS %xmm13,(\off - 0x70)(%rax) - MOVAPS %xmm12,(\off - 0x60)(%rax) - MOVAPS %xmm11,(\off - 0x50)(%rax) - MOVAPS %xmm10,(\off - 0x40)(%rax) - MOVAPS %xmm9, (\off - 0x30)(%rax) - MOVAPS %xmm8, (\off - 0x20)(%rax) - MOVAPS %xmm7, (\off - 0x10)(%rax) - MOVAPS %xmm6, \off(%rax) -.endm +#define SSE_SAVE \ + MOVAPS %xmm15,-0x30(%rax); \ + MOVAPS %xmm14,-0x20(%rax); \ + MOVAPS %xmm13,-0x10(%rax); \ + MOVAPS %xmm12, (%rax); \ + MOVAPS %xmm11, 0x10(%rax); \ + MOVAPS %xmm10, 0x20(%rax); \ + MOVAPS %xmm9, 0x30(%rax); \ + MOVAPS %xmm8, 0x40(%rax); \ + MOVAPS %xmm7, 0x50(%rax); \ + MOVAPS %xmm6, 0x60(%rax) /* Restore SSE registers 6-15. off is the offset of rsi to get to xmm6. */ -.macro SSE_RESTORE off=0 - MOVAPS (\off - 0x90)(%rsi), %xmm15 - MOVAPS (\off - 0x80)(%rsi), %xmm14 - MOVAPS (\off - 0x70)(%rsi), %xmm13 - MOVAPS (\off - 0x60)(%rsi), %xmm12 - MOVAPS (\off - 0x50)(%rsi), %xmm11 - MOVAPS (\off - 0x40)(%rsi), %xmm10 - MOVAPS (\off - 0x30)(%rsi), %xmm9 - MOVAPS (\off - 0x20)(%rsi), %xmm8 - MOVAPS (\off - 0x10)(%rsi), %xmm7 - MOVAPS \off(%rsi), %xmm6 -.endm +#define SSE_RESTORE \ + MOVAPS -0x30(%rsi), %xmm15; \ + MOVAPS -0x20(%rsi), %xmm14; \ + MOVAPS -0x10(%rsi), %xmm13; \ + MOVAPS (%rsi), %xmm12; \ + MOVAPS 0x10(%rsi), %xmm11; \ + MOVAPS 0x20(%rsi), %xmm10; \ + MOVAPS 0x30(%rsi), %xmm9 ; \ + MOVAPS 0x40(%rsi), %xmm8 ; \ + MOVAPS 0x50(%rsi), %xmm7 ; \ + MOVAPS 0x60(%rsi), %xmm6 #endif /* __SSE2__ */ #endif /* I386_ASM_H */ diff --git a/libgcc/config/i386/resms64.S b/libgcc/config/i386/resms64.S index f47e2f066fb..f842c20a77a 100644 --- a/libgcc/config/i386/resms64.S +++ b/libgcc/config/i386/resms64.S @@ -43,7 +43,7 @@ HIDDEN_FUNC(__resms64_13) mov -0x48(%rsi),%rbx HIDDEN_FUNC(__resms64_12) mov -0x40(%rsi),%rdi - SSE_RESTORE off=0x60 + SSE_RESTORE mov -0x38(%rsi),%rsi ret FUNC_END(__resms64_12) diff --git a/libgcc/config/i386/resms64f.S b/libgcc/config/i386/resms64f.S index 817da60cf15..81946cda944 100644 --- a/libgcc/config/i386/resms64f.S +++ b/libgcc/config/i386/resms64f.S @@ -42,7 +42,7 @@ HIDDEN_FUNC(__resms64f_13) mov -0x48(%rsi),%rbx HIDDEN_FUNC(__resms64f_12) mov -0x40(%rsi),%rdi - SSE_RESTORE off=0x60 + SSE_RESTORE mov -0x38(%rsi),%rsi ret FUNC_END(__resms64f_12) diff --git a/libgcc/config/i386/resms64fx.S b/libgcc/config/i386/resms64fx.S index 5dba5848dee..acf34fa0837 100644 --- a/libgcc/config/i386/resms64fx.S +++ b/libgcc/config/i386/resms64fx.S @@ -43,7 +43,7 @@ HIDDEN_FUNC(__resms64fx_13) mov -0x48(%rsi),%rbx HIDDEN_FUNC(__resms64fx_12) mov -0x40(%rsi),%rdi - SSE_RESTORE off=0x60 + SSE_RESTORE mov -0x38(%rsi),%rsi leaveq ret diff --git a/libgcc/config/i386/resms64x.S b/libgcc/config/i386/resms64x.S index 7770447cf38..e27aab7d881 100644 --- a/libgcc/config/i386/resms64x.S +++ b/libgcc/config/i386/resms64x.S @@ -44,7 +44,7 @@ HIDDEN_FUNC(__resms64x_13) mov -0x48(%rsi),%rbx HIDDEN_FUNC(__resms64x_12) mov -0x40(%rsi),%rdi - SSE_RESTORE off=0x60 + SSE_RESTORE mov -0x38(%rsi),%rsi mov %r10,%rsp ret diff --git a/libgcc/config/i386/savms64.S b/libgcc/config/i386/savms64.S index 2067dd8614f..44dda46ec54 100644 --- a/libgcc/config/i386/savms64.S +++ b/libgcc/config/i386/savms64.S @@ -44,7 +44,7 @@ HIDDEN_FUNC(__savms64_13) HIDDEN_FUNC(__savms64_12) mov %rdi,-0x40(%rax) mov %rsi,-0x38(%rax) - SSE_SAVE off=0x60 + SSE_SAVE ret FUNC_END(__savms64_12) FUNC_END(__savms64_13) diff --git a/libgcc/config/i386/savms64f.S b/libgcc/config/i386/savms64f.S index 81583b6eb68..64e91ac0394 100644 --- a/libgcc/config/i386/savms64f.S +++ b/libgcc/config/i386/savms64f.S @@ -43,7 +43,7 @@ HIDDEN_FUNC(__savms64f_13) HIDDEN_FUNC(__savms64f_12) mov %rdi,-0x40(%rax) mov %rsi,-0x38(%rax) - SSE_SAVE off=0x60 + SSE_SAVE ret FUNC_END(__savms64f_12) FUNC_END(__savms64f_13) diff --git a/libgcc/config/rs6000/ibm-ldouble.c b/libgcc/config/rs6000/ibm-ldouble.c index 949b50c98ca..e99652e523f 100644 --- a/libgcc/config/rs6000/ibm-ldouble.c +++ b/libgcc/config/rs6000/ibm-ldouble.c @@ -45,7 +45,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see This code currently assumes the most significant double is in the lower numbered register or lower addressed memory. */ -#if defined (__MACH__) || defined (__powerpc__) || defined (_AIX) +#if (defined (__MACH__) || defined (__powerpc__) || defined (_AIX)) \ + && !defined (__rtems__) #define fabs(x) __builtin_fabs(x) #define isless(x, y) __builtin_isless (x, y) diff --git a/libgcc/config/t-vxworks b/libgcc/config/t-vxworks index d67e446b46d..bbbb16deede 100644 --- a/libgcc/config/t-vxworks +++ b/libgcc/config/t-vxworks @@ -2,12 +2,13 @@ LIBGCC2_DEBUG_CFLAGS = # Extra libgcc2 modules used by gthr-vxworks.h functions -LIB2ADD = $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c +LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c -# This ensures that the correct target headers are used; some -# VxWorks system headers have names that collide with GCC's -# internal (host) headers, e.g. regs.h. -LIBGCC2_INCLUDES = -nostdinc \ +# This ensures that the correct target headers are used; some VxWorks +# system headers have names that collide with GCC's internal (host) +# headers, e.g. regs.h. Make sure the local libgcc headers still +# prevail (e.g. unwind.h). +LIBGCC2_INCLUDES = -nostdinc -I. \ `case "/$(MULTIDIR)" in \ */mrtp*) echo -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip ;; \ *) echo -I$(WIND_BASE)/target/h -I$(WIND_BASE)/target/h/wrn/coreip ;; \ diff --git a/libgcc/config/t-vxworks7 b/libgcc/config/t-vxworks7 index 77591cd642c..ae1dff9ccbd 100644 --- a/libgcc/config/t-vxworks7 +++ b/libgcc/config/t-vxworks7 @@ -4,11 +4,12 @@ LIBGCC2_DEBUG_CFLAGS = # Extra libgcc2 modules used by gthr-vxworks.h functions LIB2ADDEH += $(srcdir)/config/vxlib.c $(srcdir)/config/vxlib-tls.c -# This ensures that the correct target headers are used; some -# VxWorks system headers have names that collide with GCC's -# internal (host) headers, e.g. regs.h. +# This ensures that the correct target headers are used; some VxWorks +# system headers have names that collide with GCC's internal (host) +# headers, e.g. regs.h. Make sure the local libgcc headers still +# prevail (e.g. unwind.h). LIBGCC2_INCLUDES = -nostdinc \ - -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \ + -I. -I$(VSB_DIR)/h -I$(VSB_DIR)/share/h \ `case "/$(MULTIDIR)" in \ */mrtp*) echo -I$(VSB_DIR)/usr/h/public -I$(VSB_DIR)/usr/h ;; \ *) echo -I$(VSB_DIR)/krnl/h/system -I$(VSB_DIR)/krnl/h/public ;; \ |