summaryrefslogtreecommitdiff
path: root/sysdeps/s390/s390-64
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2016-08-20 19:50:45 +0200
commit4dd9e35bfd35d3138bc44169baba098005bad51e (patch)
treea4939c43a9c3fe00eb27f023e14acc5e1fe8808c /sysdeps/s390/s390-64
parentbd42a4599d1b6f77bcfe1e4f67b7cbd9e1cb2dfd (diff)
parentf76453c31593957fec1a99b986bfa5506618b79c (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'sysdeps/s390/s390-64')
-rw-r--r--sysdeps/s390/s390-64/Makefile8
-rw-r--r--sysdeps/s390/s390-64/__longjmp.c (renamed from sysdeps/s390/s390-64/__longjmp-common.c)27
-rw-r--r--sysdeps/s390/s390-64/add_n.S2
-rw-r--r--sysdeps/s390/s390-64/backtrace.c15
-rw-r--r--sysdeps/s390/s390-64/bcopy.S2
-rw-r--r--sysdeps/s390/s390-64/bits/wordsize.h1
-rw-r--r--sysdeps/s390/s390-64/bzero.S2
-rw-r--r--sysdeps/s390/s390-64/configure5
-rw-r--r--sysdeps/s390/s390-64/configure.ac6
-rw-r--r--sysdeps/s390/s390-64/crti.S2
-rw-r--r--sysdeps/s390/s390-64/crtn.S2
-rw-r--r--sysdeps/s390/s390-64/dl-machine.h24
-rw-r--r--sysdeps/s390/s390-64/dl-trampoline.S2
-rw-r--r--sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c2
-rw-r--r--sysdeps/s390/s390-64/memchr.S2
-rw-r--r--sysdeps/s390/s390-64/memcmp.S6
-rw-r--r--sysdeps/s390/s390-64/memcpy.S12
-rw-r--r--sysdeps/s390/s390-64/memset.S6
-rw-r--r--sysdeps/s390/s390-64/multiarch/ifunc-resolve.c22
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcmp.S18
-rw-r--r--sysdeps/s390/s390-64/multiarch/memcpy.S20
-rw-r--r--sysdeps/s390/s390-64/multiarch/memset.S24
-rw-r--r--sysdeps/s390/s390-64/s390x-mcount.S2
-rw-r--r--sysdeps/s390/s390-64/setjmp.S (renamed from sysdeps/s390/s390-64/setjmp-common.S)51
-rw-r--r--sysdeps/s390/s390-64/start.S2
-rw-r--r--sysdeps/s390/s390-64/strcmp.S2
-rw-r--r--sysdeps/s390/s390-64/strcpy.S2
-rw-r--r--sysdeps/s390/s390-64/strncpy.S2
-rw-r--r--sysdeps/s390/s390-64/sub_n.S2
-rw-r--r--sysdeps/s390/s390-64/sysdep.h2
-rw-r--r--sysdeps/s390/s390-64/tst-audit.h2
-rw-r--r--sysdeps/s390/s390-64/utf16-utf32-z9.c13
-rw-r--r--sysdeps/s390/s390-64/utf8-utf16-z9.c29
-rw-r--r--sysdeps/s390/s390-64/utf8-utf32-z9.c35
34 files changed, 200 insertions, 154 deletions
diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
index 37f021c5e0..ce4f0c5c88 100644
--- a/sysdeps/s390/s390-64/Makefile
+++ b/sysdeps/s390/s390-64/Makefile
@@ -28,6 +28,10 @@ s390x-iconv-modules = ISO-8859-1_CP037_Z900 UTF8_UTF16_Z9 UTF16_UTF32_Z9 UTF8_UT
extra-modules-left += $(s390x-iconv-modules)
include extra-module.mk
+cpp-srcs-left := $(foreach mod,$(s390x-iconv-modules),$($(mod)-routines))
+lib := iconvdata
+include $(patsubst %,$(..)cppflags-iterator.mk,$(cpp-srcs-left))
+
extra-objs += $(addsuffix .so, $(s390x-iconv-modules))
install-others += $(patsubst %, $(inst_gconvdir)/%.so, $(s390x-iconv-modules))
@@ -76,8 +80,8 @@ ifeq (no,$(cross-compiling))
# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
# if this libc has more gconv modules than the previously installed one.
if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
- LC_ALL=C LANGUAGE=C \
- $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
+ LC_ALL=C \
+ $(rtld-prefix) \
$(common-objpfx)iconv/iconvconfig \
$(addprefix --prefix=,$(install_root)); \
fi
diff --git a/sysdeps/s390/s390-64/__longjmp-common.c b/sysdeps/s390/s390-64/__longjmp.c
index 46cabb67bc..e75e648a32 100644
--- a/sysdeps/s390/s390-64/__longjmp-common.c
+++ b/sysdeps/s390/s390-64/__longjmp.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
@@ -22,10 +22,11 @@
#include <bits/setjmp.h>
#include <stdlib.h>
#include <unistd.h>
+#include <stap-probe.h>
/* Jump to the position specified by ENV, causing the
setjmp call there to return VAL, or 1 if VAL is 0. */
-attribute_hidden void
+void
__longjmp (__jmp_buf env, int val)
{
#ifdef PTR_DEMANGLE
@@ -42,7 +43,20 @@ __longjmp (__jmp_buf env, int val)
register void *r1 __asm ("%r1") = (void *) env;
#endif
/* Restore registers and jump back. */
- asm volatile ("ld %%f8,80(%1)\n\t"
+ asm volatile (
+ /* longjmp probe expects longjmp first argument, second
+ argument and target address. */
+#ifdef PTR_DEMANGLE
+ "lmg %%r4,%%r5,64(%1)\n\t"
+ "xgr %%r4,%2\n\t"
+ "xgr %%r5,%2\n\t"
+ LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r4)
+#else
+ LIBC_PROBE_ASM (longjmp, 8@%1 -4@%0 8@%%r14)
+#endif
+
+ /* restore fpregs */
+ "ld %%f8,80(%1)\n\t"
"ld %%f9,88(%1)\n\t"
"ld %%f10,96(%1)\n\t"
"ld %%f11,104(%1)\n\t"
@@ -50,15 +64,16 @@ __longjmp (__jmp_buf env, int val)
"ld %%f13,120(%1)\n\t"
"ld %%f14,128(%1)\n\t"
"ld %%f15,136(%1)\n\t"
+
+ /* restore gregs and return to jmp_buf target */
#ifdef PTR_DEMANGLE
"lmg %%r6,%%r13,0(%1)\n\t"
- "lmg %%r4,%%r5,64(%1)\n\t"
- "xgr %%r4,%2\n\t"
- "xgr %%r5,%2\n\t"
"lgr %%r15,%%r5\n\t"
+ LIBC_PROBE_ASM (longjmp_target, 8@%1 -4@%0 8@%%r4)
"br %%r4"
#else
"lmg %%r6,%%r15,0(%1)\n\t"
+ LIBC_PROBE_ASM (longjmp_target, 8@%1 -4@%0 8@%%r14)
"br %%r14"
#endif
: : "r" (r2),
diff --git a/sysdeps/s390/s390-64/add_n.S b/sysdeps/s390/s390-64/add_n.S
index 6bbd61db9a..cd71e21929 100644
--- a/sysdeps/s390/s390-64/add_n.S
+++ b/sysdeps/s390/s390-64/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) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/backtrace.c b/sysdeps/s390/s390-64/backtrace.c
index 39a15e0f0f..08e563e0df 100644
--- a/sysdeps/s390/s390-64/backtrace.c
+++ b/sysdeps/s390/s390-64/backtrace.c
@@ -1,5 +1,5 @@
/* Return backtrace of current program state. 64 bit S/390 version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky <schwidefsky@de.ibm.com>.
This file is part of the GNU C Library.
@@ -76,12 +76,8 @@ init (void)
if (unwind_getip == NULL)
unwind_backtrace = NULL;
}
-#else
-# define unwind_backtrace _Unwind_Backtrace
-# define unwind_getip _Unwind_GetIP
-#endif
-int
+static int
__backchain_backtrace (void **array, int size)
{
/* We assume that all the code is generated with frame pointers set. */
@@ -106,6 +102,10 @@ __backchain_backtrace (void **array, int size)
return cnt;
}
+#else
+# define unwind_backtrace _Unwind_Backtrace
+# define unwind_getip _Unwind_GetIP
+#endif
static _Unwind_Reason_Code
backtrace_helper (struct _Unwind_Context *ctx, void *a)
@@ -129,9 +129,10 @@ __backtrace (void **array, int size)
__libc_once_define (static, once);
__libc_once (once, init);
-#endif
+
if (unwind_backtrace == NULL)
return __backchain_backtrace (array, size);
+#endif
if (size >= 1)
unwind_backtrace (backtrace_helper, &arg);
diff --git a/sysdeps/s390/s390-64/bcopy.S b/sysdeps/s390/s390-64/bcopy.S
index fdfbfdfb0b..cbde16d2cb 100644
--- a/sysdeps/s390/s390-64/bcopy.S
+++ b/sysdeps/s390/s390-64/bcopy.S
@@ -1,6 +1,6 @@
/* bcopy -- copy a block from source to destination. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2000-2014 Free Software Foundation, Inc.
+ Copyright (C) 2000-2015 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-64/bits/wordsize.h b/sysdeps/s390/s390-64/bits/wordsize.h
index b41661217f..da791fa28e 100644
--- a/sysdeps/s390/s390-64/bits/wordsize.h
+++ b/sysdeps/s390/s390-64/bits/wordsize.h
@@ -4,6 +4,7 @@
# define __WORDSIZE 64
#else
# define __WORDSIZE 32
+# define __WORDSIZE32_SIZE_ULONG 1
#endif
#if !defined __NO_LONG_DOUBLE_MATH && !defined __LONG_DOUBLE_MATH_OPTIONAL
diff --git a/sysdeps/s390/s390-64/bzero.S b/sysdeps/s390/s390-64/bzero.S
index 4d0527aee9..355142b3e1 100644
--- a/sysdeps/s390/s390-64/bzero.S
+++ b/sysdeps/s390/s390-64/bzero.S
@@ -1,6 +1,6 @@
/* bzero -- set a block of memory to zero. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/configure b/sysdeps/s390/s390-64/configure
deleted file mode 100644
index 024565f85a..0000000000
--- a/sysdeps/s390/s390-64/configure
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file is generated from configure.ac by Autoconf. DO NOT EDIT!
- # Local configure fragment for sysdeps/s390.
-
-$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-
diff --git a/sysdeps/s390/s390-64/configure.ac b/sysdeps/s390/s390-64/configure.ac
deleted file mode 100644
index b5af4e12fc..0000000000
--- a/sysdeps/s390/s390-64/configure.ac
+++ /dev/null
@@ -1,6 +0,0 @@
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/s390.
-
-dnl It is always possible to access static and hidden symbols in an
-dnl position independent way.
-AC_DEFINE(PI_STATIC_AND_HIDDEN)
diff --git a/sysdeps/s390/s390-64/crti.S b/sysdeps/s390/s390-64/crti.S
index c13c18bbf6..7b8bb82050 100644
--- a/sysdeps/s390/s390-64/crti.S
+++ b/sysdeps/s390/s390-64/crti.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for 64 bit S/390.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/crtn.S b/sysdeps/s390/s390-64/crtn.S
index 399d3ceff8..622f2e2db0 100644
--- a/sysdeps/s390/s390-64/crtn.S
+++ b/sysdeps/s390/s390-64/crtn.S
@@ -1,5 +1,5 @@
/* Special .init and .fini section support for 64 bit S/390.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/dl-machine.h b/sysdeps/s390/s390-64/dl-machine.h
index e919223c6a..eeadbcd163 100644
--- a/sysdeps/s390/s390-64/dl-machine.h
+++ b/sysdeps/s390/s390-64/dl-machine.h
@@ -1,6 +1,6 @@
/* Machine-dependent ELF dynamic relocation inline functions.
64 bit S/390 Version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -103,7 +103,7 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
to intercept the calls to collect information. In this case we
don't store the address in the GOT so that all future calls also
end in this function. */
- if (__builtin_expect (profile, 0))
+ if (__glibc_unlikely (profile))
{
got[2] = (Elf64_Addr) &_dl_runtime_profile;
@@ -175,7 +175,7 @@ _dl_start_user:\n\
lgr %r5,%r3\n\
sllg %r5,%r5,3\n\
la %r5,176(%r5,%r15)\n\
- brasl %r14,_dl_init_internal@PLT\n\
+ brasl %r14,_dl_init@PLT\n\
# Pass our finalizer function to the user in %r14, as per ELF ABI.\n\
lghi %r14,_dl_fini@GOT\n\
lg %r14,0(%r14,%r12)\n\
@@ -192,7 +192,7 @@ _dl_start_user:\n\
/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or
TLS variable, so undefined references should not be allowed to
define the value.
- ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
+ ELF_RTYPE_CLASS_COPY iff TYPE should not be allowed to resolve to one
of the main executable's symbols, as for a COPY reloc. */
#define elf_machine_type_class(type) \
((((type) == R_390_JMP_SLOT || (type) == R_390_TLS_DTPMOD \
@@ -205,6 +205,7 @@ _dl_start_user:\n\
/* The 64 bit S/390 never uses Elf64_Rel relocations. */
#define ELF_MACHINE_NO_REL 1
+#define ELF_MACHINE_NO_RELA 0
/* We define an initialization functions. This is called very early in
_dl_sysdep_start. */
@@ -255,7 +256,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
- if (__builtin_expect (r_type == R_390_RELATIVE, 0))
+ if (__glibc_unlikely (r_type == R_390_RELATIVE))
{
# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
/* This is defined in rtld.c, but nowhere in the static libc.a;
@@ -273,11 +274,12 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
}
else
#endif
- if (__builtin_expect (r_type == R_390_NONE, 0))
+ if (__glibc_unlikely (r_type == R_390_NONE))
return;
else
{
-#ifndef RESOLVE_CONFLICT_FIND_MAP
+#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
+ /* Only needed for R_390_COPY below. */
const Elf64_Sym *const refsym = sym;
#endif
struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
@@ -294,7 +296,7 @@ elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
{
case R_390_IRELATIVE:
value = map->l_addr + reloc->r_addend;
- if (__builtin_expect (!skip_ifunc, 1))
+ if (__glibc_likely (!skip_ifunc))
value = elf_ifunc_invoke (value);
*reloc_addr = value;
break;
@@ -432,7 +434,7 @@ elf_machine_lazy_rel (struct link_map *map,
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
/* Check for unexpected PLT reloc type. */
- if (__builtin_expect (r_type == R_390_JMP_SLOT, 1))
+ if (__glibc_likely (r_type == R_390_JMP_SLOT))
{
if (__builtin_expect (map->l_mach.plt, 0) == 0)
*reloc_addr += l_addr;
@@ -441,10 +443,10 @@ elf_machine_lazy_rel (struct link_map *map,
map->l_mach.plt
+ (((Elf64_Addr) reloc_addr) - map->l_mach.gotplt) * 4;
}
- else if (__builtin_expect (r_type == R_390_IRELATIVE, 1))
+ else if (__glibc_likely (r_type == R_390_IRELATIVE))
{
Elf64_Addr value = map->l_addr + reloc->r_addend;
- if (__builtin_expect (!skip_ifunc, 1))
+ if (__glibc_likely (!skip_ifunc))
value = elf_ifunc_invoke (value);
*reloc_addr = value;
}
diff --git a/sysdeps/s390/s390-64/dl-trampoline.S b/sysdeps/s390/s390-64/dl-trampoline.S
index 87c6d50ced..f93b3fbc70 100644
--- a/sysdeps/s390/s390-64/dl-trampoline.S
+++ b/sysdeps/s390/s390-64/dl-trampoline.S
@@ -1,5 +1,5 @@
/* PLT trampolines. s390x version.
- Copyright (C) 2005-2014 Free Software Foundation, Inc.
+ Copyright (C) 2005-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
diff --git a/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c b/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c
index 1c0bf29ad7..d020fd01db 100644
--- a/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c
+++ b/sysdeps/s390/s390-64/iso-8859-1_cp037_z900.c
@@ -2,7 +2,7 @@
This module uses the Z900 variant of the Translate One To One
instruction.
- Copyright (C) 1997-2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
diff --git a/sysdeps/s390/s390-64/memchr.S b/sysdeps/s390/s390-64/memchr.S
index ebda569829..6e0c555200 100644
--- a/sysdeps/s390/s390-64/memchr.S
+++ b/sysdeps/s390/s390-64/memchr.S
@@ -1,5 +1,5 @@
/* Search a character in a block of memory. 64 bit S/390 version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/memcmp.S b/sysdeps/s390/s390-64/memcmp.S
index 51b247526a..6767438f28 100644
--- a/sysdeps/s390/s390-64/memcmp.S
+++ b/sysdeps/s390/s390-64/memcmp.S
@@ -1,5 +1,5 @@
/* memcmp - compare two memory blocks. 64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -27,7 +27,7 @@
.text
#ifdef USE_MULTIARCH
-ENTRY(memcmp_z900)
+ENTRY(__memcmp_z900)
#else
ENTRY(memcmp)
#endif
@@ -56,7 +56,7 @@ ENTRY(memcmp)
.L_Z900_15:
clc 0(1,%r3),0(%r2)
#ifdef USE_MULTIARCH
-END(memcmp_z900)
+END(__memcmp_z900)
#else
END(memcmp)
libc_hidden_builtin_def (memcmp)
diff --git a/sysdeps/s390/s390-64/memcpy.S b/sysdeps/s390/s390-64/memcpy.S
index a7e2a744a3..3f122dcf0f 100644
--- a/sysdeps/s390/s390-64/memcpy.S
+++ b/sysdeps/s390/s390-64/memcpy.S
@@ -1,5 +1,5 @@
/* memcpy - copy a block from source to destination. 64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -29,7 +29,7 @@
.text
#ifdef USE_MULTIARCH
-ENTRY(memcpy_z900)
+ENTRY(__memcpy_z900)
#else
ENTRY(memcpy)
#endif
@@ -48,7 +48,7 @@ ENTRY(memcpy)
br %r14
.L_Z900_13:
chi %r5,4096 # Switch to mvcle for copies >1MB
- jh memcpy_mvcle
+ jh __memcpy_mvcle
.L_Z900_12:
mvc 0(256,%r1),0(%r3)
la %r1,256(%r1)
@@ -59,13 +59,13 @@ ENTRY(memcpy)
mvc 0(1,%r1),0(%r3)
#ifdef USE_MULTIARCH
-END(memcpy_z900)
+END(__memcpy_z900)
#else
END(memcpy)
libc_hidden_builtin_def (memcpy)
#endif
-ENTRY(memcpy_mvcle)
+ENTRY(__memcpy_mvcle)
# Using as standalone function will result in unexpected
# results since the length field is incremented by 1 in order to
# compensate the changes already done in the functions above.
@@ -78,4 +78,4 @@ ENTRY(memcpy_mvcle)
jo .L_MVCLE_1
lgr %r2,%r1 # return destination address
br %r14
-END(memcpy_mvcle)
+END(__memcpy_mvcle)
diff --git a/sysdeps/s390/s390-64/memset.S b/sysdeps/s390/s390-64/memset.S
index 791b81d433..1e307d7ec8 100644
--- a/sysdeps/s390/s390-64/memset.S
+++ b/sysdeps/s390/s390-64/memset.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. 64 bit S/390 version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -29,7 +29,7 @@
.text
#ifdef USE_MULTIARCH
-ENTRY(memset_z900)
+ENTRY(__memset_z900)
#else
ENTRY(memset)
#endif
@@ -57,7 +57,7 @@ ENTRY(memset)
.L_Z900_18:
mvc 1(1,%r1),0(%r1)
#ifdef USE_MULTIARCH
-END(memset_z900)
+END(__memset_z900)
#else
END(memset)
libc_hidden_builtin_def (memset)
diff --git a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
index f8c69ffbb8..b303304f31 100644
--- a/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
+++ b/sysdeps/s390/s390-64/multiarch/ifunc-resolve.c
@@ -1,6 +1,6 @@
/* IFUNC resolver function for CPU specific functions.
64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -23,22 +23,22 @@
#define STFLE_BITS_Z10 34 /* General instructions extension */
#define STFLE_BITS_Z196 45 /* Distinct operands, pop ... */
-#ifndef NOT_IN_libc
+#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" \
+ ".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##_z900 attribute_hidden; \
+ extern void *__##FUNC##_z196 attribute_hidden; \
+ extern void *__##FUNC##_z10 attribute_hidden; \
+ extern void *__##FUNC##_z900 attribute_hidden; \
\
- void *resolve_##FUNC (unsigned long int dl_hwcap) \
+ void *__resolve_##FUNC (unsigned long int dl_hwcap) \
{ \
if (dl_hwcap & HWCAP_S390_STFLE) \
{ \
@@ -54,14 +54,14 @@
: : "cc"); \
\
if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z196))) != 0) \
- return &FUNC##_z196; \
+ return &__##FUNC##_z196; \
else if ((stfle_bits & (1UL << (63 - STFLE_BITS_Z10))) != 0) \
- return &FUNC##_z10; \
+ return &__##FUNC##_z10; \
else \
- return &FUNC##_z900; \
+ return &__##FUNC##_z900; \
} \
else \
- return &FUNC##_z900; \
+ return &__##FUNC##_z900; \
}
IFUNC_RESOLVE(memset)
diff --git a/sysdeps/s390/s390-64/multiarch/memcmp.S b/sysdeps/s390/s390-64/multiarch/memcmp.S
index c31d7c446c..049847d9cf 100644
--- a/sysdeps/s390/s390-64/multiarch/memcmp.S
+++ b/sysdeps/s390/s390-64/multiarch/memcmp.S
@@ -1,5 +1,5 @@
/* CPU specific memcmp implementations. 64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -27,9 +27,9 @@
.text
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
-ENTRY(memcmp_z196)
+ENTRY(__memcmp_z196)
.machine "z196"
ltgr %r4,%r4
je .L_Z196_4
@@ -60,9 +60,9 @@ ENTRY(memcmp_z196)
br %r14
.L_Z196_14:
clc 0(1,%r3),0(%r2)
-END(memcmp_z196)
+END(__memcmp_z196)
-ENTRY(memcmp_z10)
+ENTRY(__memcmp_z10)
.machine "z10"
ltgr %r4,%r4
je .L_Z10_4
@@ -87,15 +87,15 @@ ENTRY(memcmp_z10)
j .L_Z10_3
.L_Z10_15:
clc 0(1,%r3),0(%r2)
-END(memcmp_z10)
+END(__memcmp_z10)
#endif
#include "../memcmp.S"
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
.globl memcmp
-.set memcmp,memcmp_z900
+.set memcmp,__memcmp_z900
.weak bcmp
-.set bcmp,memcmp_z900
+.set bcmp,__memcmp_z900
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memcpy.S b/sysdeps/s390/s390-64/multiarch/memcpy.S
index 6590f43f27..fc670c7ac4 100644
--- a/sysdeps/s390/s390-64/multiarch/memcpy.S
+++ b/sysdeps/s390/s390-64/multiarch/memcpy.S
@@ -1,5 +1,5 @@
/* CPU specific memcpy implementations. 64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -27,9 +27,9 @@
.text
-#if defined SHARED && !defined NOT_IN_libc
+#if defined SHARED && IS_IN (libc)
-ENTRY(memcpy_z196)
+ENTRY(__memcpy_z196)
.machine "z196"
ltgr %r4,%r4
je .L_Z196_4
@@ -44,7 +44,7 @@ ENTRY(memcpy_z196)
br %r14
.L_Z196_5:
cgfi %r5,262144 # Switch to mvcle for copies >64MB
- jh memcpy_mvcle
+ jh __memcpy_mvcle
.L_Z196_2:
pfd 1,768(%r3)
pfd 2,768(%r1)
@@ -56,9 +56,9 @@ ENTRY(memcpy_z196)
j .L_Z196_3
.L_Z196_14:
mvc 0(1,%r1),0(%r3)
-END(memcpy_z196)
+END(__memcpy_z196)
-ENTRY(memcpy_z10)
+ENTRY(__memcpy_z10)
.machine "z10"
cgije %r4,0,.L_Z10_4
aghi %r4,-1
@@ -71,7 +71,7 @@ ENTRY(memcpy_z10)
br %r14
.L_Z10_13:
cgfi %r5,65535 # Switch to mvcle for copies >16MB
- jh memcpy_mvcle
+ jh __memcpy_mvcle
.L_Z10_12:
pfd 1,768(%r3)
pfd 2,768(%r1)
@@ -82,13 +82,13 @@ ENTRY(memcpy_z10)
j .L_Z10_3
.L_Z10_15:
mvc 0(1,%r1),0(%r3)
-END(memcpy_z10)
+END(__memcpy_z10)
#endif
#include "../memcpy.S"
-#if !defined SHARED || defined NOT_IN_libc
+#if !defined SHARED || !IS_IN (libc)
.globl memcpy
-.set memcpy,memcpy_z900
+.set memcpy,__memcpy_z900
#endif
diff --git a/sysdeps/s390/s390-64/multiarch/memset.S b/sysdeps/s390/s390-64/multiarch/memset.S
index 3b962696dd..3ac110a7e0 100644
--- a/sysdeps/s390/s390-64/multiarch/memset.S
+++ b/sysdeps/s390/s390-64/multiarch/memset.S
@@ -1,5 +1,5 @@
/* Set a block of memory to some byte value. 64 bit S/390 version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ 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
@@ -27,9 +27,9 @@
.text
-#ifndef NOT_IN_libc
+#if IS_IN (libc)
-ENTRY(memset_z196)
+ENTRY(__memset_z196)
.machine "z196"
ltgr %r4,%r4
je .L_Z196_4
@@ -47,7 +47,7 @@ ENTRY(memset_z196)
br %r14
.L_Z196_1:
cgfi %r5,1048576
- jh memset_mvcle # Switch to mvcle for >256MB
+ jh __memset_mvcle # Switch to mvcle for >256MB
.L_Z196_2:
pfd 2,1024(%r1)
mvc 1(256,%r1),0(%r1)
@@ -57,9 +57,9 @@ ENTRY(memset_z196)
j .L_Z196_3
.L_Z196_17:
mvc 1(1,%r1),0(%r1)
-END(memset_z196)
+END(__memset_z196)
-ENTRY(memset_z10)
+ENTRY(__memset_z10)
.machine "z10"
cgije %r4,0,.L_Z10_4
stc %r3,0(%r2)
@@ -74,7 +74,7 @@ ENTRY(memset_z10)
br %r14
.L_Z10_15:
cgfi %r5,163840 # Switch to mvcle for >40MB
- jh memset_mvcle
+ jh __memset_mvcle
.L_Z10_14:
pfd 2,1024(%r1)
mvc 1(256,%r1),0(%r1)
@@ -83,9 +83,9 @@ ENTRY(memset_z10)
j .L_Z10_3
.L_Z10_18:
mvc 1(1,%r1),0(%r1)
-END(memset_z10)
+END(__memset_z10)
-ENTRY(memset_mvcle)
+ENTRY(__memset_mvcle)
aghi %r4,2 # take back the change done by the caller
lgr %r0,%r2 # save source address
lgr %r1,%r3 # move pad byte to R1
@@ -97,13 +97,13 @@ ENTRY(memset_mvcle)
lgr %r2,%r0 # return value is source address
.L1:
br %r14
-END(memset_mvcle)
+END(__memset_mvcle)
#endif
#include "../memset.S"
-#ifdef NOT_IN_libc
+#if !IS_IN (libc)
.globl memset
-.set memset,memset_z900
+.set memset,__memset_z900
#endif
diff --git a/sysdeps/s390/s390-64/s390x-mcount.S b/sysdeps/s390/s390-64/s390x-mcount.S
index a4364bd256..dec92af012 100644
--- a/sysdeps/s390/s390-64/s390x-mcount.S
+++ b/sysdeps/s390/s390-64/s390x-mcount.S
@@ -1,5 +1,5 @@
/* 64 bit S/390-specific implemetation of profiling support.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/setjmp-common.S b/sysdeps/s390/s390-64/setjmp.S
index 9cdcae45c5..330a8e6c62 100644
--- a/sysdeps/s390/s390-64/setjmp-common.S
+++ b/sysdeps/s390/s390-64/setjmp.S
@@ -1,5 +1,5 @@
/* setjmp for 64 bit S/390, ELF version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 Free Software Foundation, Inc.
Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
This file is part of the GNU C Library.
@@ -21,30 +21,42 @@
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
+#include <shlib-compat.h>
+#include <stap-probe.h>
+
+#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 __sigsetjmp __v1__sigsetjmp
+# 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. */
ENTRY (setjmp)
.weak C_SYMBOL_NAME (setjmp)
lghi %r3,1 /* Second argument of one. */
- j 0f /* Branch relativ to __sigsetjmp. */
+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
END (setjmp)
/* Binary compatibility entry point. */
ENTRY(_setjmp)
.weak C_SYMBOL_NAME (_setjmp)
slgr %r3,%r3 /* Second argument of zero. */
- j 0f /* Branch relativ to __sigsetjmp. */
+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
END (_setjmp)
libc_hidden_def (_setjmp)
ENTRY(__setjmp)
slgr %r3,%r3 /* Second argument of zero. */
- j 0f /* Branch relativ to __sigsetjmp. */
+ j .Linternal_sigsetjmp /* Branch relativ to __sigsetjmp. */
END (__setjmp)
ENTRY(__sigsetjmp)
-0:
+.Linternal_sigsetjmp:
+ /* setjmp probe expects sig/setjmp first argument (8@%r2), second
+ argument (-8@%r3) and target address (8@%r14). */
+ LIBC_PROBE (setjmp, 3, 8@%r2, -4@%r3, 8@%r14)
#ifdef PTR_MANGLE
stmg %r6,%r13,0(%r2) /* Store registers in jmp_buf. */
lgr %r4,%r14
@@ -55,10 +67,6 @@ ENTRY(__sigsetjmp)
#else
stmg %r6,%r15,0(%r2) /* Store registers in jmp_buf. */
#endif
-#ifndef __V1_JMPBUF
- lghi %r4,0
- stg %r4,144(%r2) /* Set __flags to 0. */
-#endif
std %f8,80(%r2)
std %f9,88(%r2)
std %f10,96(%r2)
@@ -67,7 +75,7 @@ ENTRY(__sigsetjmp)
std %f13,120(%r2)
std %f14,128(%r2)
std %f15,136(%r2)
-#if defined NOT_IN_libc && defined IS_IN_rtld
+#if IS_IN (rtld)
/* In ld.so we never save the signal mask. */
lghi %r2,0
br %r14
@@ -77,3 +85,26 @@ ENTRY(__sigsetjmp)
jg __sigjmp_save
#endif
END (__sigsetjmp)
+
+#if !IS_IN (rtld)
+# if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20)
+/* 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 __sigsetjmp
+
+weak_alias (setjmp, __v1setjmp);
+weak_alias (setjmp, __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);
+versioned_symbol (libc, __v1_setjmp, _setjmp, GLIBC_2_0);
+compat_symbol (libc, __v2_setjmp, _setjmp, GLIBC_2_19);
+
+strong_alias (__v1__sigsetjmp, __v2__sigsetjmp);
+versioned_symbol (libc, __v1__sigsetjmp, __sigsetjmp, GLIBC_2_0);
+compat_symbol (libc, __v2__sigsetjmp, __sigsetjmp, GLIBC_2_19);
+# endif /* if defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_19, GLIBC_2_20) */
+#endif /* if !IS_IN (rtld) */
diff --git a/sysdeps/s390/s390-64/start.S b/sysdeps/s390/s390-64/start.S
index 5dcdbc4160..48c11b13e5 100644
--- a/sysdeps/s390/s390-64/start.S
+++ b/sysdeps/s390/s390-64/start.S
@@ -1,5 +1,5 @@
/* Startup code compliant to the 64 bit S/390 ELF ABI.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/strcmp.S b/sysdeps/s390/s390-64/strcmp.S
index 7e7380649e..7b4be304ec 100644
--- a/sysdeps/s390/s390-64/strcmp.S
+++ b/sysdeps/s390/s390-64/strcmp.S
@@ -1,6 +1,6 @@
/* strcmp - compare two string. 64 bit S/390 version.
This file is part of the GNU C Library.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/strcpy.S b/sysdeps/s390/s390-64/strcpy.S
index 72c2de2d5d..8ad0aeefd6 100644
--- a/sysdeps/s390/s390-64/strcpy.S
+++ b/sysdeps/s390/s390-64/strcpy.S
@@ -1,5 +1,5 @@
/* strcpy - copy a string from source to destination. 64 bit S/390 version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/strncpy.S b/sysdeps/s390/s390-64/strncpy.S
index 9d2dc861fe..2d433078ec 100644
--- a/sysdeps/s390/s390-64/strncpy.S
+++ b/sysdeps/s390/s390-64/strncpy.S
@@ -1,6 +1,6 @@
/* strncpy - copy at most n characters from a string from source to
destination. 64 bit S/390 version
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/sub_n.S b/sysdeps/s390/s390-64/sub_n.S
index 65223d0050..5a0ac3021f 100644
--- a/sysdeps/s390/s390-64/sub_n.S
+++ b/sysdeps/s390/s390-64/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. 64 bit S/390 version.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/sysdep.h b/sysdeps/s390/s390-64/sysdep.h
index 0d45ceff1e..c70ef7e2b1 100644
--- a/sysdeps/s390/s390-64/sysdep.h
+++ b/sysdeps/s390/s390-64/sysdep.h
@@ -1,5 +1,5 @@
/* Assembler macros for 64 bit S/390.
- Copyright (C) 2001-2014 Free Software Foundation, Inc.
+ Copyright (C) 2001-2015 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-64/tst-audit.h b/sysdeps/s390/s390-64/tst-audit.h
index 05edc7d5b7..2c5dbe1d0b 100644
--- a/sysdeps/s390/s390-64/tst-audit.h
+++ b/sysdeps/s390/s390-64/tst-audit.h
@@ -1,6 +1,6 @@
/* Definitions for testing PLT entry/exit auditing. S/390 64-bit version.
- Copyright (C) 2012-2014 Free Software Foundation, Inc.
+ Copyright (C) 2012-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
diff --git a/sysdeps/s390/s390-64/utf16-utf32-z9.c b/sysdeps/s390/s390-64/utf16-utf32-z9.c
index f7d9e07957..f887c34e61 100644
--- a/sysdeps/s390/s390-64/utf16-utf32-z9.c
+++ b/sysdeps/s390/s390-64/utf16-utf32-z9.c
@@ -2,7 +2,7 @@
This module uses the Z9-109 variants of the Convert Unicode
instructions.
- Copyright (C) 1997-2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -44,6 +44,7 @@
#define FROM_LOOP from_utf16_loop
#define TO_LOOP to_utf16_loop
#define FROM_DIRECTION (dir == from_utf16)
+#define ONE_DIRECTION 0
#define PREPARE_LOOP \
enum direction dir = ((struct utf16_data *) step->__data)->dir; \
int emit_bom = ((struct utf16_data *) step->__data)->emit_bom; \
@@ -54,7 +55,7 @@
if (dir == to_utf16) \
{ \
/* Emit the UTF-16 Byte Order Mark. */ \
- if (__builtin_expect (outbuf + 2 > outend, 0)) \
+ if (__glibc_unlikely (outbuf + 2 > outend)) \
return __GCONV_FULL_OUTPUT; \
\
put16u (outbuf, BOM_UTF16); \
@@ -63,7 +64,7 @@
else \
{ \
/* Emit the UTF-32 Byte Order Mark. */ \
- if (__builtin_expect (outbuf + 4 > outend, 0)) \
+ if (__glibc_unlikely (outbuf + 4 > outend)) \
return __GCONV_FULL_OUTPUT; \
\
put32u (outbuf, BOM_UTF32); \
@@ -236,13 +237,13 @@ gconv_end (struct __gconv_step *data)
{ \
/* An isolated low-surrogate was found. This has to be \
considered ill-formed. */ \
- if (__builtin_expect (u1 >= 0xdc00, 0)) \
+ if (__glibc_unlikely (u1 >= 0xdc00)) \
{ \
STANDARD_FROM_LOOP_ERR_HANDLER (2); \
} \
/* It's a surrogate character. At least the first word says \
it is. */ \
- if (__builtin_expect (inptr + 4 > inend, 0)) \
+ if (__glibc_unlikely (inptr + 4 > inend)) \
{ \
/* We don't have enough input for another complete input \
character. */ \
@@ -306,7 +307,7 @@ gconv_end (struct __gconv_step *data)
uint16_t out; \
\
/* Generate a surrogate character. */ \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
diff --git a/sysdeps/s390/s390-64/utf8-utf16-z9.c b/sysdeps/s390/s390-64/utf8-utf16-z9.c
index 863677455c..1425cb116a 100644
--- a/sysdeps/s390/s390-64/utf8-utf16-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf16-z9.c
@@ -2,7 +2,7 @@
This module uses the Z9-109 variants of the Convert Unicode
instructions.
- Copyright (C) 1997-2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -42,6 +42,7 @@
#define FROM_LOOP from_utf8_loop
#define TO_LOOP to_utf8_loop
#define FROM_DIRECTION (dir == from_utf8)
+#define ONE_DIRECTION 0
#define PREPARE_LOOP \
enum direction dir = ((struct utf8_data *) step->__data)->dir; \
int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
@@ -50,7 +51,7 @@
&& data->__invocation_counter == 0) \
{ \
/* Emit the UTF-16 Byte Order Mark. */ \
- if (__builtin_expect (outbuf + 2 > outend, 0)) \
+ if (__glibc_unlikely (outbuf + 2 > outend)) \
return __GCONV_FULL_OUTPUT; \
\
put16u (outbuf, BOM_UTF16); \
@@ -197,7 +198,7 @@ gconv_end (struct __gconv_step *data)
if ((inptr[i] & 0xc0) != 0x80) \
break; \
\
- if (__builtin_expect (inptr + i == inend, 1)) \
+ if (__glibc_likely (inptr + i == inend)) \
{ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -210,7 +211,7 @@ gconv_end (struct __gconv_step *data)
/* Next input byte. */ \
uint16_t ch = *inptr; \
\
- if (__builtin_expect (ch < 0x80, 1)) \
+ if (__glibc_likely (ch < 0x80)) \
{ \
/* One byte sequence. */ \
++inptr; \
@@ -228,13 +229,13 @@ gconv_end (struct __gconv_step *data)
cnt = 2; \
ch &= 0x1f; \
} \
- else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
{ \
/* We expect three bytes. */ \
cnt = 3; \
ch &= 0x0f; \
} \
- else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
{ \
/* We expect four bytes. */ \
cnt = 4; \
@@ -255,7 +256,7 @@ gconv_end (struct __gconv_step *data)
STANDARD_FROM_LOOP_ERR_HANDLER (i); \
} \
\
- if (__builtin_expect (inptr + cnt > inend, 0)) \
+ if (__glibc_unlikely (inptr + cnt > inend)) \
{ \
/* We don't have enough input. But before we report \
that check that all the bytes are correct. */ \
@@ -263,7 +264,7 @@ gconv_end (struct __gconv_step *data)
if ((inptr[i] & 0xc0) != 0x80) \
break; \
\
- if (__builtin_expect (inptr + i == inend, 1)) \
+ if (__glibc_likely (inptr + i == inend)) \
{ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -278,7 +279,7 @@ gconv_end (struct __gconv_step *data)
low) are needed. */ \
uint16_t zabcd, high, low; \
\
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -368,7 +369,7 @@ gconv_end (struct __gconv_step *data)
\
uint16_t c = get16 (inptr); \
\
- if (__builtin_expect (c <= 0x007f, 1)) \
+ if (__glibc_likely (c <= 0x007f)) \
{ \
/* Single byte UTF-8 char. */ \
*outptr = c & 0xff; \
@@ -378,7 +379,7 @@ gconv_end (struct __gconv_step *data)
{ \
/* Two byte UTF-8 char. */ \
\
- if (__builtin_expect (outptr + 2 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 2 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -397,7 +398,7 @@ gconv_end (struct __gconv_step *data)
{ \
/* Three byte UTF-8 char. */ \
\
- if (__builtin_expect (outptr + 3 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 3 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -419,14 +420,14 @@ gconv_end (struct __gconv_step *data)
/* Four byte UTF-8 char. */ \
uint16_t low, uvwxy; \
\
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
break; \
} \
inptr += 2; \
- if (__builtin_expect (inptr + 2 > inend, 0)) \
+ if (__glibc_unlikely (inptr + 2 > inend)) \
{ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
diff --git a/sysdeps/s390/s390-64/utf8-utf32-z9.c b/sysdeps/s390/s390-64/utf8-utf32-z9.c
index 5120837037..9a74448285 100644
--- a/sysdeps/s390/s390-64/utf8-utf32-z9.c
+++ b/sysdeps/s390/s390-64/utf8-utf32-z9.c
@@ -2,7 +2,7 @@
This module uses the Z9-109 variants of the Convert Unicode
instructions.
- Copyright (C) 1997-2014 Free Software Foundation, Inc.
+ Copyright (C) 1997-2015 Free Software Foundation, Inc.
Author: Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
Based on the work by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -44,6 +44,7 @@
#define FROM_LOOP from_utf8_loop
#define TO_LOOP to_utf8_loop
#define FROM_DIRECTION (dir == from_utf8)
+#define ONE_DIRECTION 0
#define PREPARE_LOOP \
enum direction dir = ((struct utf8_data *) step->__data)->dir; \
int emit_bom = ((struct utf8_data *) step->__data)->emit_bom; \
@@ -52,7 +53,7 @@
&& data->__invocation_counter == 0) \
{ \
/* Emit the Byte Order Mark. */ \
- if (__builtin_expect (outbuf + 4 > outend, 0)) \
+ if (__glibc_unlikely (outbuf + 4 > outend)) \
return __GCONV_FULL_OUTPUT; \
\
put32u (outbuf, BOM); \
@@ -201,7 +202,7 @@ gconv_end (struct __gconv_step *data)
if ((inptr[i] & 0xc0) != 0x80) \
break; \
\
- if (__builtin_expect (inptr + i == inend, 1)) \
+ if (__glibc_likely (inptr + i == inend)) \
{ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -214,7 +215,7 @@ gconv_end (struct __gconv_step *data)
/* Next input byte. */ \
uint32_t ch = *inptr; \
\
- if (__builtin_expect (ch < 0x80, 1)) \
+ if (__glibc_likely (ch < 0x80)) \
{ \
/* One byte sequence. */ \
++inptr; \
@@ -232,25 +233,25 @@ gconv_end (struct __gconv_step *data)
cnt = 2; \
ch &= 0x1f; \
} \
- else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
{ \
/* We expect three bytes. */ \
cnt = 3; \
ch &= 0x0f; \
} \
- else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
{ \
/* We expect four bytes. */ \
cnt = 4; \
ch &= 0x07; \
} \
- else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1)) \
+ else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \
{ \
/* We expect five bytes. */ \
cnt = 5; \
ch &= 0x03; \
} \
- else if (__builtin_expect ((ch & 0xfe) == 0xfc, 1)) \
+ else if (__glibc_likely ((ch & 0xfe) == 0xfc)) \
{ \
/* We expect six bytes. */ \
cnt = 6; \
@@ -271,7 +272,7 @@ gconv_end (struct __gconv_step *data)
STANDARD_FROM_LOOP_ERR_HANDLER (i); \
} \
\
- if (__builtin_expect (inptr + cnt > inend, 0)) \
+ if (__glibc_unlikely (inptr + cnt > inend)) \
{ \
/* We don't have enough input. But before we report \
that check that all the bytes are correct. */ \
@@ -279,7 +280,7 @@ gconv_end (struct __gconv_step *data)
if ((inptr[i] & 0xc0) != 0x80) \
break; \
\
- if (__builtin_expect (inptr + i == inend, 1)) \
+ if (__glibc_likely (inptr + i == inend)) \
{ \
result = __GCONV_INCOMPLETE_INPUT; \
break; \
@@ -338,19 +339,19 @@ gconv_end (struct __gconv_step *data)
cnt = 2; \
ch &= 0x1f; \
} \
- else if (__builtin_expect ((ch & 0xf0) == 0xe0, 1)) \
+ else if (__glibc_likely ((ch & 0xf0) == 0xe0)) \
{ \
/* We expect three bytes. */ \
cnt = 3; \
ch &= 0x0f; \
} \
- else if (__builtin_expect ((ch & 0xf8) == 0xf0, 1)) \
+ else if (__glibc_likely ((ch & 0xf8) == 0xf0)) \
{ \
/* We expect four bytes. */ \
cnt = 4; \
ch &= 0x07; \
} \
- else if (__builtin_expect ((ch & 0xfc) == 0xf8, 1)) \
+ else if (__glibc_likely ((ch & 0xfc) == 0xf8)) \
{ \
/* We expect five bytes. */ \
cnt = 5; \
@@ -431,7 +432,7 @@ gconv_end (struct __gconv_step *data)
\
uint32_t wc = *((const uint32_t *) inptr); \
\
- if (__builtin_expect (wc <= 0x7f, 1)) \
+ if (__glibc_likely (wc <= 0x7f)) \
{ \
/* Single UTF-8 char. */ \
*outptr = (uint8_t)wc; \
@@ -440,7 +441,7 @@ gconv_end (struct __gconv_step *data)
else if (wc <= 0x7ff) \
{ \
/* Two UTF-8 chars. */ \
- if (__builtin_expect (outptr + 2 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 2 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -458,7 +459,7 @@ gconv_end (struct __gconv_step *data)
else if (wc <= 0xffff) \
{ \
/* Three UTF-8 chars. */ \
- if (__builtin_expect (outptr + 3 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 3 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \
@@ -478,7 +479,7 @@ gconv_end (struct __gconv_step *data)
else if (wc <= 0x10ffff) \
{ \
/* Four UTF-8 chars. */ \
- if (__builtin_expect (outptr + 4 > outend, 0)) \
+ if (__glibc_unlikely (outptr + 4 > outend)) \
{ \
/* Overflow in the output buffer. */ \
result = __GCONV_FULL_OUTPUT; \