diff options
Diffstat (limited to 'sysdeps/s390/s390-32')
39 files changed, 512 insertions, 423 deletions
diff --git a/sysdeps/s390/s390-32/__longjmp.c b/sysdeps/s390/s390-32/__longjmp.c index b253934083..2631cfd32f 100644 --- a/sysdeps/s390/s390-32/__longjmp.c +++ b/sysdeps/s390/s390-32/__longjmp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2000-2015 Free Software Foundation, Inc. +/* Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). @@ -37,46 +37,46 @@ __longjmp (__jmp_buf env, int val) #elif defined CHECK_SP CHECK_SP (env, 0); #endif - register int r2 __asm ("%r2") = val == 0 ? 1 : val; + register int r2 __asm__ ("%r2") = val == 0 ? 1 : val; #ifdef PTR_DEMANGLE - register uintptr_t r3 __asm ("%r3") = guard; - register void *r1 __asm ("%r1") = (void *) env; + register uintptr_t r3 __asm__ ("%r3") = guard; + register void *r1 __asm__ ("%r1") = (void *) env; #endif /* Restore registers and jump back. */ - asm volatile ( + __asm__ __volatile__ ( /* longjmp probe expects longjmp first argument, second argument and target address. */ #ifdef PTR_DEMANGLE - "lm %%r4,%%r5,32(%1)\n\t" - "xr %%r4,%2\n\t" - "xr %%r5,%2\n\t" - LIBC_PROBE_ASM (longjmp, 4@%1 -4@%0 4@%%r4) + "lm %%r4,%%r5,32(%1)\n\t" + "xr %%r4,%2\n\t" + "xr %%r5,%2\n\t" + LIBC_PROBE_ASM (longjmp, 4@%1 -4@%0 4@%%r4) #else - LIBC_PROBE_ASM (longjmp, 4@%1 -4@%0 4@%%r14) + LIBC_PROBE_ASM (longjmp, 4@%1 -4@%0 4@%%r14) #endif - /* restore fpregs */ - "ld %%f6,48(%1)\n\t" - "ld %%f4,40(%1)\n\t" + /* restore fpregs */ + "ld %%f6,48(%1)\n\t" + "ld %%f4,40(%1)\n\t" - /* restore gregs and return to jmp_buf target */ + /* restore gregs and return to jmp_buf target */ #ifdef PTR_DEMANGLE - "lm %%r6,%%r13,0(%1)\n\t" - "lr %%r15,%%r5\n\t" - LIBC_PROBE_ASM (longjmp_target, 4@%1 -4@%0 4@%%r4) - "br %%r4" + "lm %%r6,%%r13,0(%1)\n\t" + "lr %%r15,%%r5\n\t" + LIBC_PROBE_ASM (longjmp_target, 4@%1 -4@%0 4@%%r4) + "br %%r4" #else - "lm %%r6,%%r15,0(%1)\n\t" - LIBC_PROBE_ASM (longjmp_target, 4@%1 -4@%0 4@%%r14) - "br %%r14" + "lm %%r6,%%r15,0(%1)\n\t" + LIBC_PROBE_ASM (longjmp_target, 4@%1 -4@%0 4@%%r14) + "br %%r14" #endif - : : "r" (r2), + : : "r" (r2), #ifdef PTR_DEMANGLE - "r" (r1), "r" (r3) + "r" (r1), "r" (r3) #else - "a" (env) + "a" (env) #endif - ); + ); /* Avoid `volatile function does return' warnings. */ for (;;); diff --git a/sysdeps/s390/s390-32/add_n.S b/sysdeps/s390/s390-32/add_n.S index 0e0927837f..b8e915712e 100644 --- a/sysdeps/s390/s390-32/add_n.S +++ b/sysdeps/s390/s390-32/add_n.S @@ -1,6 +1,6 @@ /* Add two limb vectors of the same length > 0 and store sum in a third limb vector. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU MP Library. diff --git a/sysdeps/s390/s390-32/addmul_1.S b/sysdeps/s390/s390-32/addmul_1.S index f6575234ea..160c599d16 100644 --- a/sysdeps/s390/s390-32/addmul_1.S +++ b/sysdeps/s390/s390-32/addmul_1.S @@ -1,6 +1,6 @@ /* S390 __mpn_addmul_1 -- Multiply a limb vector with a limb and add the result to a second limb vector. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU MP Library. diff --git a/sysdeps/s390/s390-32/backtrace.c b/sysdeps/s390/s390-32/backtrace.c index 73db65275d..a8290ed86a 100644 --- a/sysdeps/s390/s390-32/backtrace.c +++ b/sysdeps/s390/s390-32/backtrace.c @@ -1,5 +1,5 @@ /* Return backtrace of current program state. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>. This file is part of the GNU C Library. @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#include <bits/libc-lock.h> +#include <libc-lock.h> #include <dlfcn.h> #include <execinfo.h> #include <stddef.h> @@ -85,7 +85,7 @@ __backchain_backtrace (void **array, int size) struct layout *stack; int cnt = 0; - asm ("LR %0,%%r15" : "=d" (stack) ); + __asm__ ("LR %0,%%r15" : "=d" (stack) ); /* We skip the call to this function, it makes no sense to record it. */ stack = (struct layout *) stack->back_chain; while (cnt < size) @@ -126,6 +126,10 @@ int __backtrace (void **array, int size) { struct trace_arg arg = { .array = array, .size = size, .cnt = -1 }; + + if (size <= 0) + return 0; + #ifdef SHARED __libc_once_define (static, once); @@ -135,8 +139,7 @@ __backtrace (void **array, int size) return __backchain_backtrace (array, size); #endif - if (size >= 1) - unwind_backtrace (backtrace_helper, &arg); + unwind_backtrace (backtrace_helper, &arg); return arg.cnt != -1 ? arg.cnt : 0; } diff --git a/sysdeps/s390/s390-32/bcopy.S b/sysdeps/s390/s390-32/bcopy.S index 0a42f93f23..cc64cb9aa7 100644 --- a/sysdeps/s390/s390-32/bcopy.S +++ b/sysdeps/s390/s390-32/bcopy.S @@ -1,6 +1,6 @@ /* bcopy -- copy a block from source to destination. S/390 version. This file is part of the GNU C Library. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/bzero.S b/sysdeps/s390/s390-32/bzero.S index 7c03c3eb9d..4cbb62e06e 100644 --- a/sysdeps/s390/s390-32/bzero.S +++ b/sysdeps/s390/s390-32/bzero.S @@ -1,6 +1,6 @@ /* bzero -- set a block of memory to zero. IBM S390 version This file is part of the GNU C Library. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/crti.S b/sysdeps/s390/s390-32/crti.S index 87444a9ffc..5db5b1e900 100644 --- a/sysdeps/s390/s390-32/crti.S +++ b/sysdeps/s390/s390-32/crti.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for S/390. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/crtn.S b/sysdeps/s390/s390-32/crtn.S index fcf2788af0..73677917dc 100644 --- a/sysdeps/s390/s390-32/crtn.S +++ b/sysdeps/s390/s390-32/crtn.S @@ -1,5 +1,5 @@ /* Special .init and .fini section support for S/390. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/dl-machine.h b/sysdeps/s390/s390-32/dl-machine.h index 119e7b568c..14bde3b58d 100644 --- a/sysdeps/s390/s390-32/dl-machine.h +++ b/sysdeps/s390/s390-32/dl-machine.h @@ -1,5 +1,5 @@ /* Machine-dependent ELF dynamic relocation inline functions. S390 Version. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Carl Pederson & Martin Schwidefsky. This file is part of the GNU C Library. @@ -55,10 +55,10 @@ elf_machine_dynamic (void) { register Elf32_Addr *got; - asm( " bras %0,2f\n" - "1: .long _GLOBAL_OFFSET_TABLE_-1b\n" - "2: al %0,0(%0)" - : "=&a" (got) : : "0" ); + __asm__( " bras %0,2f\n" + "1: .long _GLOBAL_OFFSET_TABLE_-1b\n" + "2: al %0,0(%0)" + : "=&a" (got) : : "0" ); return *got; } @@ -70,14 +70,14 @@ elf_machine_load_address (void) { Elf32_Addr addr; - asm( " bras 1,2f\n" - "1: .long _GLOBAL_OFFSET_TABLE_ - 1b\n" - " .long (_dl_start - 1b - 0x80000000) & 0x00000000ffffffff\n" - "2: l %0,4(1)\n" - " ar %0,1\n" - " al 1,0(1)\n" - " sl %0,_dl_start@GOT(1)" - : "=&d" (addr) : : "1" ); + __asm__( " bras 1,2f\n" + "1: .long _GLOBAL_OFFSET_TABLE_ - 1b\n" + " .long (_dl_start - 1b - 0x80000000) & 0x00000000ffffffff\n" + "2: l %0,4(1)\n" + " ar %0,1\n" + " al 1,0(1)\n" + " sl %0,_dl_start@GOT(1)" + : "=&d" (addr) : : "1" ); return addr; } @@ -141,7 +141,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) The C function `_dl_start' is the real entry point; its return value is the user program's entry point. */ -#define RTLD_START asm ("\n\ +#define RTLD_START __asm__ ("\n\ .text\n\ .align 4\n\ .globl _start\n\ diff --git a/sysdeps/s390/s390-32/dl-sysdep.h b/sysdeps/s390/s390-32/dl-sysdep.h index d7a4e53ba3..d550d15985 100644 --- a/sysdeps/s390/s390-32/dl-sysdep.h +++ b/sysdeps/s390/s390-32/dl-sysdep.h @@ -1,5 +1,5 @@ /* System-specific settings for dynamic linker code. S/390 version. - Copyright (C) 2014-2015 Free Software Foundation, Inc. + Copyright (C) 2014-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/dl-trampoline.S b/sysdeps/s390/s390-32/dl-trampoline.S index df3e7dbec2..1645610383 100644 --- a/sysdeps/s390/s390-32/dl-trampoline.S +++ b/sysdeps/s390/s390-32/dl-trampoline.S @@ -1,5 +1,5 @@ /* PLT trampolines. s390 version. - Copyright (C) 2005-2015 Free Software Foundation, Inc. + Copyright (C) 2005-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/memchr.S b/sysdeps/s390/s390-32/memchr.S index af550ca372..5c82af4b90 100644 --- a/sysdeps/s390/s390-32/memchr.S +++ b/sysdeps/s390/s390-32/memchr.S @@ -1,5 +1,5 @@ /* Search a character in a block of memory. For IBM S390 - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). diff --git a/sysdeps/s390/s390-32/memcmp.S b/sysdeps/s390/s390-32/memcmp.S index 93f06d57a3..50ab61c77f 100644 --- a/sysdeps/s390/s390-32/memcmp.S +++ b/sysdeps/s390/s390-32/memcmp.S @@ -1,5 +1,5 @@ /* memcmp - compare two memory blocks. 32 bit S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -27,38 +27,38 @@ .text #ifdef USE_MULTIARCH -ENTRY(__memcmp_g5) +ENTRY(__memcmp_default) #else ENTRY(memcmp) #endif .machine "g5" - basr %r5,0 + basr %r5,0 .L_G5_16: - ltr %r4,%r4 - je .L_G5_4 - ahi %r4,-1 - lr %r1,%r4 - srl %r1,8 - ltr %r1,%r1 - jne .L_G5_12 - ex %r4,.L_G5_17-.L_G5_16(%r5) + ltr %r4,%r4 + je .L_G5_4 + ahi %r4,-1 + lr %r1,%r4 + srl %r1,8 + ltr %r1,%r1 + jne .L_G5_12 + ex %r4,.L_G5_17-.L_G5_16(%r5) .L_G5_4: - ipm %r2 - sll %r2,2 - sra %r2,30 - br %r14 + ipm %r2 + sll %r2,2 + sra %r2,30 + br %r14 .L_G5_12: - clc 0(256,%r3),0(%r2) - jne .L_G5_4 - la %r3,256(%r3) - la %r2,256(%r2) - brct %r1,.L_G5_12 - ex %r4,.L_G5_17-.L_G5_16(%r5) - j .L_G5_4 + clc 0(256,%r3),0(%r2) + jne .L_G5_4 + la %r3,256(%r3) + la %r2,256(%r2) + brct %r1,.L_G5_12 + ex %r4,.L_G5_17-.L_G5_16(%r5) + j .L_G5_4 .L_G5_17: - clc 0(1,%r3),0(%r2) + clc 0(1,%r3),0(%r2) #ifdef USE_MULTIARCH -END(__memcmp_g5) +END(__memcmp_default) #else END(memcmp) libc_hidden_builtin_def (memcmp) diff --git a/sysdeps/s390/s390-32/memcpy.S b/sysdeps/s390/s390-32/memcpy.S index f26fd00ff8..62ecbbf619 100644 --- a/sysdeps/s390/s390-32/memcpy.S +++ b/sysdeps/s390/s390-32/memcpy.S @@ -1,5 +1,5 @@ /* memcpy - copy a block from source to destination. S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -26,41 +26,41 @@ %r4 = number of bytes to copy. */ #ifdef USE_MULTIARCH -ENTRY(__memcpy_g5) +ENTRY(__memcpy_default) #else ENTRY(memcpy) #endif .machine "g5" - st %r13,52(%r15) - .cfi_offset 13, -44 - basr %r13,0 + st %r13,52(%r15) + .cfi_offset 13, -44 + basr %r13,0 .L_G5_16: - ltr %r4,%r4 - je .L_G5_4 - ahi %r4,-1 - lr %r5,%r4 - srl %r5,8 - ltr %r5,%r5 - lr %r1,%r2 - jne .L_G5_12 - ex %r4,.L_G5_17-.L_G5_16(%r13) + ltr %r4,%r4 + je .L_G5_4 + ahi %r4,-1 + lr %r5,%r4 + srl %r5,8 + ltr %r5,%r5 + lr %r1,%r2 + jne .L_G5_12 + ex %r4,.L_G5_17-.L_G5_16(%r13) .L_G5_4: - l %r13,52(%r15) - br %r14 + l %r13,52(%r15) + br %r14 .L_G5_13: - chi %r5,4096 # Switch to mvcle for copies >1MB - jh __memcpy_mvcle + chi %r5,4096 # Switch to mvcle for copies >1MB + jh __memcpy_mvcle .L_G5_12: - mvc 0(256,%r1),0(%r3) - la %r1,256(%r1) - la %r3,256(%r3) - brct %r5,.L_G5_12 - ex %r4,.L_G5_17-.L_G5_16(%r13) - j .L_G5_4 + mvc 0(256,%r1),0(%r3) + la %r1,256(%r1) + la %r3,256(%r3) + brct %r5,.L_G5_12 + ex %r4,.L_G5_17-.L_G5_16(%r13) + j .L_G5_4 .L_G5_17: - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) #ifdef USE_MULTIARCH -END(__memcpy_g5) +END(__memcpy_default) #else END(memcpy) libc_hidden_builtin_def (memcpy) diff --git a/sysdeps/s390/s390-32/memset.S b/sysdeps/s390/s390-32/memset.S index 0abba61c22..eca65d4a49 100644 --- a/sysdeps/s390/s390-32/memset.S +++ b/sysdeps/s390/s390-32/memset.S @@ -1,5 +1,5 @@ /* Set a block of memory to some byte value. For IBM S390 - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -28,37 +28,37 @@ .text #ifdef USE_MULTIARCH -ENTRY(__memset_g5) +ENTRY(__memset_default) #else ENTRY(memset) #endif .machine "g5" - basr %r5,0 + basr %r5,0 .L_G5_19: - ltr %r4,%r4 - je .L_G5_4 - stc %r3,0(%r2) - chi %r4,1 - lr %r1,%r2 - je .L_G5_4 - ahi %r4,-2 - lr %r3,%r4 - srl %r3,8 - ltr %r3,%r3 - jne .L_G5_14 - ex %r4,.L_G5_20-.L_G5_19(%r5) + ltr %r4,%r4 + je .L_G5_4 + stc %r3,0(%r2) + chi %r4,1 + lr %r1,%r2 + je .L_G5_4 + ahi %r4,-2 + lr %r3,%r4 + srl %r3,8 + ltr %r3,%r3 + jne .L_G5_14 + ex %r4,.L_G5_20-.L_G5_19(%r5) .L_G5_4: - br %r14 + br %r14 .L_G5_14: - mvc 1(256,%r1),0(%r1) - la %r1,256(%r1) - brct %r3,.L_G5_14 - ex %r4,.L_G5_20-.L_G5_19(%r5) - j .L_G5_4 + mvc 1(256,%r1),0(%r1) + la %r1,256(%r1) + brct %r3,.L_G5_14 + ex %r4,.L_G5_20-.L_G5_19(%r5) + j .L_G5_4 .L_G5_20: - mvc 1(1,%r1),0(%r1) + mvc 1(1,%r1),0(%r1) #ifdef USE_MULTIARCH -END(__memset_g5) +END(__memset_default) #else END(memset) libc_hidden_builtin_def (memset) diff --git a/sysdeps/s390/s390-32/mul_1.S b/sysdeps/s390/s390-32/mul_1.S index bd8b805fe0..50df39c17f 100644 --- a/sysdeps/s390/s390-32/mul_1.S +++ b/sysdeps/s390/s390-32/mul_1.S @@ -1,6 +1,6 @@ /* __mpn_mul_1 -- Multiply a limb vector with a limb and store the result in a second limb vector. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU MP Library. diff --git a/sysdeps/s390/s390-32/multiarch/Makefile b/sysdeps/s390/s390-32/multiarch/Makefile index 9baeecda64..f8aee14bbd 100644 --- a/sysdeps/s390/s390-32/multiarch/Makefile +++ b/sysdeps/s390/s390-32/multiarch/Makefile @@ -1,3 +1,4 @@ ifeq ($(subdir),string) -sysdep_routines += ifunc-resolve memset memcpy memcmp +sysdep_routines += memset memset-s390 memcpy memcpy-s390 \ + memcmp memcmp-s390 endif diff --git a/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c b/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c deleted file mode 100644 index 8e0cdd5df1..0000000000 --- a/sysdeps/s390/s390-32/multiarch/ifunc-resolve.c +++ /dev/null @@ -1,72 +0,0 @@ -/* IFUNC resolver function for CPU specific functions. - 32 bit S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library 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 - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, see - <http://www.gnu.org/licenses/>. */ - -#include <unistd.h> -#include <dl-procinfo.h> - -#define STFLE_BITS_Z10 34 /* General instructions extension */ -#define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */ - -#if IS_IN (libc) - -#define IFUNC_RESOLVE(FUNC) \ - asm (".globl " #FUNC "\n\t" \ - ".type " #FUNC ",@gnu_indirect_function\n\t" \ - ".set " #FUNC ",__resolve_" #FUNC "\n\t" \ - ".globl __GI_" #FUNC "\n\t" \ - ".set __GI_" #FUNC "," #FUNC "\n"); \ - \ - /* Make the declarations of the optimized functions hidden in order - to prevent GOT slots being generated for them. */ \ - extern void *__##FUNC##_z196 attribute_hidden; \ - extern void *__##FUNC##_z10 attribute_hidden; \ - extern void *__##FUNC##_g5 attribute_hidden; \ - \ - void *__resolve_##FUNC (unsigned long int dl_hwcap) \ - { \ - if ((dl_hwcap & HWCAP_S390_STFLE) \ - && (dl_hwcap & HWCAP_S390_ZARCH) \ - && (dl_hwcap & HWCAP_S390_HIGH_GPRS)) \ - { \ - /* We want just 1 double word to be returned. */ \ - register unsigned long reg0 asm("0") = 0; \ - unsigned long long stfle_bits; \ - \ - asm volatile(".insn s,0xb2b00000,%0" "\n\t" /* stfle */ \ - : "=QS" (stfle_bits), "+d" (reg0) \ - : : "cc"); \ - \ - if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z196))) != 0) \ - return &__##FUNC##_z196; \ - else if ((stfle_bits & (1ULL << (63 - STFLE_BITS_Z10))) != 0) \ - return &__##FUNC##_z10; \ - } \ - return &__##FUNC##_g5; \ - } - -IFUNC_RESOLVE(memset) -IFUNC_RESOLVE(memcmp) -asm(".weak bcmp ; bcmp = memcmp"); - -/* In the static lib memcpy is needed before the reloc is resolved. */ -#ifdef SHARED -IFUNC_RESOLVE(memcpy) -#endif - -#endif diff --git a/sysdeps/s390/s390-32/multiarch/memchr.c b/sysdeps/s390/s390-32/multiarch/memchr.c new file mode 100644 index 0000000000..2281e43056 --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/memchr.c @@ -0,0 +1,21 @@ +/* Multiple versions of memchr. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/memchr.S will be used. */ +#include <sysdeps/s390/multiarch/memchr.c> diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.S b/sysdeps/s390/s390-32/multiarch/memcmp-s390.S index 584dc99792..e9ee6d2270 100644 --- a/sysdeps/s390/s390-32/multiarch/memcmp.S +++ b/sysdeps/s390/s390-32/multiarch/memcmp-s390.S @@ -1,5 +1,5 @@ /* CPU specific memcmp implementations. 32 bit S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,73 +32,73 @@ ENTRY(__memcmp_z196) .machine "z196" .machinemode "zarch_nohighgprs" - ltr %r4,%r4 - je .L_Z196_4 - ahi %r4,-1 - srlk %r1,%r4,8 - ltr %r1,%r1 - jne .L_Z196_2 + ltr %r4,%r4 + je .L_Z196_4 + ahi %r4,-1 + srlk %r1,%r4,8 + ltr %r1,%r1 + jne .L_Z196_2 .L_Z196_3: - exrl %r4,.L_Z196_14 + exrl %r4,.L_Z196_14 .L_Z196_4: - ipm %r2 - sll %r2,2 - sra %r2,30 - br %r14 + ipm %r2 + sll %r2,2 + sra %r2,30 + br %r14 .L_Z196_17: - la %r3,256(%r3) - la %r2,256(%r2) - ahi %r1,-1 - je .L_Z196_3 + la %r3,256(%r3) + la %r2,256(%r2) + ahi %r1,-1 + je .L_Z196_3 .L_Z196_2: - pfd 1,512(%r3) - pfd 1,512(%r2) - clc 0(256,%r3),0(%r2) - je .L_Z196_17 - ipm %r2 - sll %r2,2 - sra %r2,30 - br %r14 + pfd 1,512(%r3) + pfd 1,512(%r2) + clc 0(256,%r3),0(%r2) + je .L_Z196_17 + ipm %r2 + sll %r2,2 + sra %r2,30 + br %r14 .L_Z196_14: - clc 0(1,%r3),0(%r2) + clc 0(1,%r3),0(%r2) END(__memcmp_z196) ENTRY(__memcmp_z10) .machine "z10" .machinemode "zarch_nohighgprs" - ltr %r4,%r4 - je .L_Z10_4 - ahi %r4,-1 - lr %r1,%r4 - srl %r1,8 - cijlh %r1,0,.L_Z10_12 + ltr %r4,%r4 + je .L_Z10_4 + ahi %r4,-1 + lr %r1,%r4 + srl %r1,8 + cijlh %r1,0,.L_Z10_12 .L_Z10_3: - exrl %r4,.L_Z10_15 + exrl %r4,.L_Z10_15 .L_Z10_4: - ipm %r2 - sll %r2,2 - sra %r2,30 - br %r14 + ipm %r2 + sll %r2,2 + sra %r2,30 + br %r14 .L_Z10_12: - pfd 1,512(%r3) - pfd 1,512(%r2) - clc 0(256,%r3),0(%r2) - jne .L_Z10_4 - la %r3,256(%r3) - la %r2,256(%r2) - brct %r1,.L_Z10_12 - j .L_Z10_3 + pfd 1,512(%r3) + pfd 1,512(%r2) + clc 0(256,%r3),0(%r2) + jne .L_Z10_4 + la %r3,256(%r3) + la %r2,256(%r2) + brct %r1,.L_Z10_12 + j .L_Z10_3 .L_Z10_15: - clc 0(1,%r3),0(%r2) + clc 0(1,%r3),0(%r2) END(__memcmp_z10) -#endif +#endif /* IS_IN (libc) */ #include "../memcmp.S" #if !IS_IN (libc) .globl memcmp -.set memcmp,__memcmp_g5 +.set memcmp,__memcmp_default .weak bcmp -.set bcmp,__memcmp_g5 +.set bcmp,__memcmp_default #endif diff --git a/sysdeps/s390/s390-32/multiarch/memcmp.c b/sysdeps/s390/s390-32/multiarch/memcmp.c new file mode 100644 index 0000000000..44f72dc8ca --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/memcmp.c @@ -0,0 +1,24 @@ +/* Multiple versions of memcmp. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if IS_IN (libc) +# include <ifunc-resolve.h> + +s390_libc_ifunc (memcmp) +__asm__(".weak bcmp ; bcmp = memcmp"); +#endif diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.S b/sysdeps/s390/s390-32/multiarch/memcpy-s390.S index 51f4fcff15..4e30cdf6c6 100644 --- a/sysdeps/s390/s390-32/multiarch/memcpy.S +++ b/sysdeps/s390/s390-32/multiarch/memcpy-s390.S @@ -1,5 +1,5 @@ /* CPU specific memcpy implementations. 32 bit S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,67 +32,67 @@ ENTRY(__memcpy_z196) .machine "z196" .machinemode "zarch_nohighgprs" - llgfr %r4,%r4 - ltgr %r4,%r4 - je .L_Z196_4 - aghi %r4,-1 - lr %r1,%r2 - srlg %r5,%r4,8 - ltgr %r5,%r5 - jne .L_Z196_5 + llgfr %r4,%r4 + ltgr %r4,%r4 + je .L_Z196_4 + aghi %r4,-1 + lr %r1,%r2 + srlg %r5,%r4,8 + ltgr %r5,%r5 + jne .L_Z196_5 .L_Z196_3: - exrl %r4,.L_Z196_14 + exrl %r4,.L_Z196_14 .L_Z196_4: - br %r14 + br %r14 .L_Z196_5: - cgfi %r5,262144 # Switch to mvcle for copies >64MB - jh __memcpy_mvcle + cgfi %r5,262144 # Switch to mvcle for copies >64MB + jh __memcpy_mvcle .L_Z196_2: - pfd 1,768(%r3) - pfd 2,768(%r1) - mvc 0(256,%r1),0(%r3) - aghi %r5,-1 - la %r1,256(%r1) - la %r3,256(%r3) - jne .L_Z196_2 - j .L_Z196_3 + pfd 1,768(%r3) + pfd 2,768(%r1) + mvc 0(256,%r1),0(%r3) + aghi %r5,-1 + la %r1,256(%r1) + la %r3,256(%r3) + jne .L_Z196_2 + j .L_Z196_3 .L_Z196_14: - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) END(__memcpy_z196) ENTRY(__memcpy_z10) .machine "z10" .machinemode "zarch_nohighgprs" - llgfr %r4,%r4 - cgije %r4,0,.L_Z10_4 - aghi %r4,-1 - lr %r1,%r2 - srlg %r5,%r4,8 - cgijlh %r5,0,.L_Z10_13 + llgfr %r4,%r4 + cgije %r4,0,.L_Z10_4 + aghi %r4,-1 + lr %r1,%r2 + srlg %r5,%r4,8 + cgijlh %r5,0,.L_Z10_13 .L_Z10_3: - exrl %r4,.L_Z10_15 + exrl %r4,.L_Z10_15 .L_Z10_4: - br %r14 + br %r14 .L_Z10_13: - cgfi %r5,65535 # Switch to mvcle for copies >16MB - jh __memcpy_mvcle + cgfi %r5,65535 # Switch to mvcle for copies >16MB + jh __memcpy_mvcle .L_Z10_12: - pfd 1,768(%r3) - pfd 2,768(%r1) - mvc 0(256,%r1),0(%r3) - la %r1,256(%r1) - la %r3,256(%r3) - brctg %r5,.L_Z10_12 - j .L_Z10_3 + pfd 1,768(%r3) + pfd 2,768(%r1) + mvc 0(256,%r1),0(%r3) + la %r1,256(%r1) + la %r3,256(%r3) + brctg %r5,.L_Z10_12 + j .L_Z10_3 .L_Z10_15: - mvc 0(1,%r1),0(%r3) + mvc 0(1,%r1),0(%r3) END(__memcpy_z10) -#endif +#endif /* SHARED && IS_IN (libc) */ #include "../memcpy.S" #if !defined SHARED || !IS_IN (libc) .globl memcpy -.set memcpy,__memcpy_g5 +.set memcpy,__memcpy_default #endif diff --git a/sysdeps/s390/s390-32/multiarch/memcpy.c b/sysdeps/s390/s390-32/multiarch/memcpy.c new file mode 100644 index 0000000000..2a98aa0b82 --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/memcpy.c @@ -0,0 +1,24 @@ +/* Multiple versions of memcpy. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* In the static lib memcpy is needed before the reloc is resolved. */ +#if defined SHARED && IS_IN (libc) +# include <ifunc-resolve.h> + +s390_libc_ifunc (memcpy) +#endif diff --git a/sysdeps/s390/s390-32/multiarch/memset.S b/sysdeps/s390/s390-32/multiarch/memset-s390.S index 1a7b45f369..47277c13a6 100644 --- a/sysdeps/s390/s390-32/multiarch/memset.S +++ b/sysdeps/s390/s390-32/multiarch/memset-s390.S @@ -1,5 +1,5 @@ /* Set a block of memory to some byte value. 32 bit S/390 version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -32,61 +32,61 @@ ENTRY(__memset_z196) .machine "z196" .machinemode "zarch_nohighgprs" - llgfr %r4,%r4 - ltgr %r4,%r4 - je .L_Z196_4 - stc %r3,0(%r2) - lr %r1,%r2 - cghi %r4,1 - je .L_Z196_4 - aghi %r4,-2 - srlg %r5,%r4,8 - ltgr %r5,%r5 - jne .L_Z196_1 + llgfr %r4,%r4 + ltgr %r4,%r4 + je .L_Z196_4 + stc %r3,0(%r2) + lr %r1,%r2 + cghi %r4,1 + je .L_Z196_4 + aghi %r4,-2 + srlg %r5,%r4,8 + ltgr %r5,%r5 + jne .L_Z196_1 .L_Z196_3: - exrl %r4,.L_Z196_17 + exrl %r4,.L_Z196_17 .L_Z196_4: - br %r14 + br %r14 .L_Z196_1: cgfi %r5,1048576 jh __memset_mvcle # Switch to mvcle for >256MB .L_Z196_2: - pfd 2,1024(%r1) - mvc 1(256,%r1),0(%r1) - aghi %r5,-1 - la %r1,256(%r1) - jne .L_Z196_2 - j .L_Z196_3 + pfd 2,1024(%r1) + mvc 1(256,%r1),0(%r1) + aghi %r5,-1 + la %r1,256(%r1) + jne .L_Z196_2 + j .L_Z196_3 .L_Z196_17: - mvc 1(1,%r1),0(%r1) + mvc 1(1,%r1),0(%r1) END(__memset_z196) ENTRY(__memset_z10) .machine "z10" .machinemode "zarch_nohighgprs" - llgfr %r4,%r4 - cgije %r4,0,.L_Z10_4 - stc %r3,0(%r2) - lr %r1,%r2 - cgije %r4,1,.L_Z10_4 - aghi %r4,-2 - srlg %r5,%r4,8 - cgijlh %r5,0,.L_Z10_15 + llgfr %r4,%r4 + cgije %r4,0,.L_Z10_4 + stc %r3,0(%r2) + lr %r1,%r2 + cgije %r4,1,.L_Z10_4 + aghi %r4,-2 + srlg %r5,%r4,8 + cgijlh %r5,0,.L_Z10_15 .L_Z10_3: - exrl %r4,.L_Z10_18 + exrl %r4,.L_Z10_18 .L_Z10_4: - br %r14 + br %r14 .L_Z10_15: cgfi %r5,163840 # Switch to mvcle for >40MB jh __memset_mvcle .L_Z10_14: - pfd 2,1024(%r1) - mvc 1(256,%r1),0(%r1) - la %r1,256(%r1) - brctg %r5,.L_Z10_14 - j .L_Z10_3 + pfd 2,1024(%r1) + mvc 1(256,%r1),0(%r1) + la %r1,256(%r1) + brctg %r5,.L_Z10_14 + j .L_Z10_3 .L_Z10_18: - mvc 1(1,%r1),0(%r1) + mvc 1(1,%r1),0(%r1) END(__memset_z10) ENTRY(__memset_mvcle) @@ -103,11 +103,11 @@ ENTRY(__memset_mvcle) br %r14 END(__memset_mvcle) -#endif +#endif /* IS_IN (libc) */ #include "../memset.S" #if !IS_IN (libc) .globl memset -.set memset,__memset_g5 +.set memset,__memset_default #endif diff --git a/sysdeps/s390/s390-32/multiarch/memset.c b/sysdeps/s390/s390-32/multiarch/memset.c new file mode 100644 index 0000000000..89b8102f2a --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/memset.c @@ -0,0 +1,23 @@ +/* Multiple versions of memset. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if IS_IN (libc) +# include <ifunc-resolve.h> + +s390_libc_ifunc (memset) +#endif diff --git a/sysdeps/s390/s390-32/multiarch/strcmp.c b/sysdeps/s390/s390-32/multiarch/strcmp.c new file mode 100644 index 0000000000..b7eebc017f --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/strcmp.c @@ -0,0 +1,21 @@ +/* Multiple versions of strcmp. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/strcmp.S will be used. */ +#include <sysdeps/s390/multiarch/strcmp.c> diff --git a/sysdeps/s390/s390-32/multiarch/strcpy.c b/sysdeps/s390/s390-32/multiarch/strcpy.c new file mode 100644 index 0000000000..ae140d22b7 --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/strcpy.c @@ -0,0 +1,21 @@ +/* Multiple versions of strcpy. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/strcpy.S will be used. */ +#include <sysdeps/s390/multiarch/strcpy.c> diff --git a/sysdeps/s390/s390-32/multiarch/strncpy.c b/sysdeps/s390/s390-32/multiarch/strncpy.c new file mode 100644 index 0000000000..28a2af72e4 --- /dev/null +++ b/sysdeps/s390/s390-32/multiarch/strncpy.c @@ -0,0 +1,21 @@ +/* Multiple versions of strncpy. + Copyright (C) 2015-2016 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +/* This wrapper-file is needed, because otherwise file + sysdeps/s390/s390-[32|64]/strncpy.S will be used. */ +#include <sysdeps/s390/multiarch/strncpy.c> diff --git a/sysdeps/s390/s390-32/s390-mcount.S b/sysdeps/s390/s390-32/s390-mcount.S index cc70641621..a27f434fbf 100644 --- a/sysdeps/s390/s390-32/s390-mcount.S +++ b/sysdeps/s390/s390-32/s390-mcount.S @@ -1,5 +1,5 @@ /* S/390-specific implemetation of profiling support. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com) diff --git a/sysdeps/s390/s390-32/setjmp.S b/sysdeps/s390/s390-32/setjmp.S index e068a3cbfe..dbacb0fdf2 100644 --- a/sysdeps/s390/s390-32/setjmp.S +++ b/sysdeps/s390/s390-32/setjmp.S @@ -1,5 +1,5 @@ /* setjmp for s390, ELF version. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. @@ -27,21 +27,23 @@ #if !IS_IN (rtld) # if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) /* we need a unique name in case of symbol versioning. */ +# define setjmp __v1setjmp +# define _setjmp __v1_setjmp # define __sigsetjmp __v1__sigsetjmp + +# undef libc_hidden_def +# define libc_hidden_def(name) strong_alias(_setjmp, __GI__setjmp) # endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */ #endif /* !IS_IN (rtld) */ - /* We include the BSD entry points here as well but we make - them weak. */ + /* We include the BSD entry points here as well. */ ENTRY (setjmp) - .weak C_SYMBOL_NAME (setjmp) lhi %r3,1 /* second argument of one */ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ END (setjmp) /* Binary compatibility entry point. */ ENTRY(_setjmp) - .weak C_SYMBOL_NAME (_setjmp) lhi %r3,0 /* second argument of zero */ j .Linternal_sigsetjmp /* branch relativ to __sigsetjmp */ END (_setjmp) @@ -96,15 +98,15 @@ END (__sigsetjmp) /* In glibc release 2.19 new versions of setjmp-functions were introduced, but were reverted before 2.20. Thus both versions are the same function. */ +# undef setjmp +# undef _setjmp # undef __sigsetjmp -weak_alias (setjmp, __v1setjmp); -weak_alias (setjmp, __v2setjmp); +strong_alias (__v1setjmp, __v2setjmp); versioned_symbol (libc, __v1setjmp, setjmp, GLIBC_2_0); compat_symbol (libc, __v2setjmp, setjmp, GLIBC_2_19); -weak_alias (_setjmp, __v1_setjmp); -weak_alias (_setjmp, __v2_setjmp); +strong_alias (__v1_setjmp, __v2_setjmp); versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0); compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19); diff --git a/sysdeps/s390/s390-32/stackguard-macros.h b/sysdeps/s390/s390-32/stackguard-macros.h index 449e8d488f..46109744ed 100644 --- a/sysdeps/s390/s390-32/stackguard-macros.h +++ b/sysdeps/s390/s390-32/stackguard-macros.h @@ -1,15 +1,15 @@ #include <stdint.h> #define STACK_CHK_GUARD \ - ({ uintptr_t x; asm ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; }) + ({ uintptr_t x; __asm__ ("ear %0,%%a0; l %0,0x14(%0)" : "=a" (x)); x; }) /* On s390/s390x there is no unique pointer guard, instead we use the same value as the stack guard. */ #define POINTER_CHK_GUARD \ - ({ \ - uintptr_t x; \ - asm ("ear %0,%%a0; l %0,%1(%0)" \ - : "=a" (x) \ - : "i" (offsetof (tcbhead_t, stack_guard))); \ - x; \ - }) + ({ \ + uintptr_t x; \ + __asm__ ("ear %0,%%a0; l %0,%1(%0)" \ + : "=a" (x) \ + : "i" (offsetof (tcbhead_t, stack_guard))); \ + x; \ + }) diff --git a/sysdeps/s390/s390-32/start.S b/sysdeps/s390/s390-32/start.S index 7d3c6d9a89..1fbc64d2e4 100644 --- a/sysdeps/s390/s390-32/start.S +++ b/sysdeps/s390/s390-32/start.S @@ -1,5 +1,5 @@ /* Startup code compliant to the ELF s390 ABI. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. diff --git a/sysdeps/s390/s390-32/strcmp.S b/sysdeps/s390/s390-32/strcmp.S index 109de12deb..71f113ebab 100644 --- a/sysdeps/s390/s390-32/strcmp.S +++ b/sysdeps/s390/s390-32/strcmp.S @@ -1,6 +1,6 @@ /* strcmp - compare two string. S/390 version. This file is part of the GNU C Library. - Copyright (C) 2001-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/strcpy.S b/sysdeps/s390/s390-32/strcpy.S index b8b9b5f34b..5cdc350f91 100644 --- a/sysdeps/s390/s390-32/strcpy.S +++ b/sysdeps/s390/s390-32/strcpy.S @@ -1,6 +1,6 @@ /* strcpy - copy a string from source to destination. For IBM S390 This file is part of the GNU C Library. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/strncpy.S b/sysdeps/s390/s390-32/strncpy.S index b0e234e2da..75800b3ee6 100644 --- a/sysdeps/s390/s390-32/strncpy.S +++ b/sysdeps/s390/s390-32/strncpy.S @@ -1,7 +1,7 @@ /* strncpy - copy at most n characters from a string from source to destination. For IBM S390 This file is part of the GNU C Library. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). The GNU C Library is free software; you can redistribute it and/or diff --git a/sysdeps/s390/s390-32/sub_n.S b/sysdeps/s390/s390-32/sub_n.S index 3ade1fe86d..f8de2c2a5e 100644 --- a/sysdeps/s390/s390-32/sub_n.S +++ b/sysdeps/s390/s390-32/sub_n.S @@ -1,6 +1,6 @@ /* __mpn_sub_n -- Add two limb vectors of the same length > 0 and store sum in a third limb vector. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU MP Library. diff --git a/sysdeps/s390/s390-32/sysdep.h b/sysdeps/s390/s390-32/sysdep.h index 779f1799b3..26e9285dbd 100644 --- a/sysdeps/s390/s390-32/sysdep.h +++ b/sysdeps/s390/s390-32/sysdep.h @@ -1,5 +1,5 @@ /* Assembler macros for s390. - Copyright (C) 2000-2015 Free Software Foundation, Inc. + Copyright (C) 2000-2016 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of the GNU C Library. diff --git a/sysdeps/s390/s390-32/tls-macros.h b/sysdeps/s390/s390-32/tls-macros.h index a592d81585..09b42aa37a 100644 --- a/sysdeps/s390/s390-32/tls-macros.h +++ b/sysdeps/s390/s390-32/tls-macros.h @@ -1,102 +1,102 @@ #define TLS_LE(x) \ ({ unsigned long __offset; \ - asm ("bras %0,1f\n" \ - "0:\t.long " #x "@ntpoff\n" \ - "1:\tl %0,0(%0)" \ - : "=a" (__offset) : : "cc" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long " #x "@ntpoff\n" \ + "1:\tl %0,0(%0)" \ + : "=a" (__offset) : : "cc" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #ifdef PIC # define TLS_IE(x) \ ({ unsigned long __offset, __got; \ - asm ("bras %0,1f\n" \ - "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ - ".long " #x "@gotntpoff\n" \ - "1:\tl %1,0(%0)\n\t" \ - "la %1,0(%1,%0)\n\t" \ - "l %0,4(%0)\n\t" \ - "l %0,0(%0,%1):tls_load:" #x "\n" \ - : "=&a" (__offset), "=&a" (__got) : : "cc" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ + ".long " #x "@gotntpoff\n" \ + "1:\tl %1,0(%0)\n\t" \ + "la %1,0(%1,%0)\n\t" \ + "l %0,4(%0)\n\t" \ + "l %0,0(%0,%1):tls_load:" #x "\n" \ + : "=&a" (__offset), "=&a" (__got) : : "cc" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #else # define TLS_IE(x) \ ({ unsigned long __offset; \ - asm ("bras %0,1f\n" \ - "0:\t.long " #x "@indntpoff\n" \ - "1:\t l %0,0(%0)\n\t" \ - "l %0,0(%0):tls_load:" #x \ - : "=&a" (__offset) : : "cc" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long " #x "@indntpoff\n" \ + "1:\t l %0,0(%0)\n\t" \ + "l %0,0(%0):tls_load:" #x \ + : "=&a" (__offset) : : "cc" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #endif #ifdef PIC # define TLS_LD(x) \ ({ unsigned long __offset, __save12; \ - asm ("bras %0,1f\n" \ - "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ - ".long __tls_get_offset@plt-0b\n\t" \ - ".long " #x "@tlsldm\n\t" \ - ".long " #x "@dtpoff\n" \ - "1:\tlr %1,%%r12\n\t" \ - "l %%r12,0(%0)\n\t" \ - "la %%r12,0(%%r12,%0)\n\t" \ - "l %%r1,4(%0)\n\t" \ - "l %%r2,8(%0)\n\t" \ - "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \ - "l %0,12(%0)\n\t" \ - "alr %0,%%r2\n\t" \ - "lr %%r12,%1" \ - : "=&a" (__offset), "=&a" (__save12) \ - : : "cc", "0", "1", "2", "3", "4", "5" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ + ".long __tls_get_offset@plt-0b\n\t" \ + ".long " #x "@tlsldm\n\t" \ + ".long " #x "@dtpoff\n" \ + "1:\tlr %1,%%r12\n\t" \ + "l %%r12,0(%0)\n\t" \ + "la %%r12,0(%%r12,%0)\n\t" \ + "l %%r1,4(%0)\n\t" \ + "l %%r2,8(%0)\n\t" \ + "bas %%r14,0(%%r1,%0):tls_ldcall:" #x "\n\t" \ + "l %0,12(%0)\n\t" \ + "alr %0,%%r2\n\t" \ + "lr %%r12,%1" \ + : "=&a" (__offset), "=&a" (__save12) \ + : : "cc", "0", "1", "2", "3", "4", "5" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #else # define TLS_LD(x) \ ({ unsigned long __offset; \ - asm ("bras %0,1f\n" \ - "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \ - ".long __tls_get_offset@plt\n\t" \ - ".long " #x "@tlsldm\n\t" \ - ".long " #x "@dtpoff\n" \ - "1:\tl %%r12,0(%0)\n\t" \ - "l %%r1,4(%0)\n\t" \ - "l %%r2,8(%0)\n\t" \ - "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \ - "l %0,12(%0)\n\t" \ - "alr %0,%%r2" \ - : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \ + ".long __tls_get_offset@plt\n\t" \ + ".long " #x "@tlsldm\n\t" \ + ".long " #x "@dtpoff\n" \ + "1:\tl %%r12,0(%0)\n\t" \ + "l %%r1,4(%0)\n\t" \ + "l %%r2,8(%0)\n\t" \ + "bas %%r14,0(%%r1):tls_ldcall:" #x "\n\t" \ + "l %0,12(%0)\n\t" \ + "alr %0,%%r2" \ + : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #endif #ifdef PIC # define TLS_GD(x) \ ({ unsigned long __offset, __save12; \ - asm ("bras %0,1f\n" \ - "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ - ".long __tls_get_offset@plt-0b\n\t" \ - ".long " #x "@tlsgd\n" \ - "1:\tlr %1,%%r12\n\t" \ - "l %%r12,0(%0)\n\t" \ - "la %%r12,0(%%r12,%0)\n\t" \ - "l %%r1,4(%0)\n\t" \ - "l %%r2,8(%0)\n\t" \ - "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \ - "lr %0,%%r2\n\t" \ - "lr %%r12,%1" \ - : "=&a" (__offset), "=&a" (__save12) \ - : : "cc", "0", "1", "2", "3", "4", "5" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long _GLOBAL_OFFSET_TABLE_-0b\n\t" \ + ".long __tls_get_offset@plt-0b\n\t" \ + ".long " #x "@tlsgd\n" \ + "1:\tlr %1,%%r12\n\t" \ + "l %%r12,0(%0)\n\t" \ + "la %%r12,0(%%r12,%0)\n\t" \ + "l %%r1,4(%0)\n\t" \ + "l %%r2,8(%0)\n\t" \ + "bas %%r14,0(%%r1,%0):tls_gdcall:" #x "\n\t" \ + "lr %0,%%r2\n\t" \ + "lr %%r12,%1" \ + : "=&a" (__offset), "=&a" (__save12) \ + : : "cc", "0", "1", "2", "3", "4", "5" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #else # define TLS_GD(x) \ ({ unsigned long __offset; \ - asm ("bras %0,1f\n" \ - "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \ - ".long __tls_get_offset@plt\n\t" \ - ".long " #x "@tlsgd\n" \ - "1:\tl %%r12,0(%0)\n\t" \ - "l %%r1,4(%0)\n\t" \ - "l %%r2,8(%0)\n\t" \ - "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \ - "lr %0,%%r2" \ - : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ + __asm__ ("bras %0,1f\n" \ + "0:\t.long _GLOBAL_OFFSET_TABLE_\n\t" \ + ".long __tls_get_offset@plt\n\t" \ + ".long " #x "@tlsgd\n" \ + "1:\tl %%r12,0(%0)\n\t" \ + "l %%r1,4(%0)\n\t" \ + "l %%r2,8(%0)\n\t" \ + "bas %%r14,0(%%r1):tls_gdcall:" #x "\n\t" \ + "lr %0,%%r2" \ + : "=&a" (__offset) : : "cc", "0", "1", "2", "3", "4", "5", "12" ); \ (int *) (__builtin_thread_pointer() + __offset); }) #endif diff --git a/sysdeps/s390/s390-32/tst-audit.h b/sysdeps/s390/s390-32/tst-audit.h index 27bc11343f..8908602cff 100644 --- a/sysdeps/s390/s390-32/tst-audit.h +++ b/sysdeps/s390/s390-32/tst-audit.h @@ -1,6 +1,6 @@ /* Definitions for testing PLT entry/exit auditing. S/390 32-bit version. - Copyright (C) 2012-2015 Free Software Foundation, Inc. + Copyright (C) 2012-2016 Free Software Foundation, Inc. This file is part of the GNU C Library. |