diff --git a/ap/libc/glibc/glibc-2.23/debug/Depend b/ap/libc/glibc/glibc-2.23/debug/Depend
new file mode 100644
index 0000000..f3e1156
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/Depend
@@ -0,0 +1 @@
+localedata
diff --git a/ap/libc/glibc/glibc-2.23/debug/Makefile b/ap/libc/glibc/glibc-2.23/debug/Makefile
new file mode 100644
index 0000000..6b5f31e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/Makefile
@@ -0,0 +1,191 @@
+# Copyright (C) 1998-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/>.
+
+#
+#	Sub-makefile for debug portion of the library.
+#
+subdir	:= debug
+
+include ../Makeconfig
+
+headers	:= execinfo.h
+
+# Note that ptsname_r_chk and getlogin_r are not here, but in
+# login/Makefile instead.  If that subdir is omitted from the
+# build, its _FORTIFY_SOURCE support will be too.
+routines  = backtrace backtracesyms backtracesymsfd noophooks \
+	    memcpy_chk memmove_chk mempcpy_chk memset_chk stpcpy_chk \
+	    strcat_chk strcpy_chk strncat_chk strncpy_chk stpncpy_chk \
+	    sprintf_chk vsprintf_chk snprintf_chk vsnprintf_chk \
+	    printf_chk fprintf_chk vprintf_chk vfprintf_chk \
+	    gets_chk chk_fail readonly-area fgets_chk fgets_u_chk \
+	    read_chk pread_chk pread64_chk recv_chk recvfrom_chk \
+	    readlink_chk readlinkat_chk getwd_chk getcwd_chk \
+	    realpath_chk fread_chk fread_u_chk \
+	    wctomb_chk wcscpy_chk wmemcpy_chk wmemmove_chk wmempcpy_chk \
+	    wcpcpy_chk wcsncpy_chk wcscat_chk wcsncat_chk wmemset_chk \
+	    wcpncpy_chk \
+	    swprintf_chk vswprintf_chk wprintf_chk fwprintf_chk \
+	    vwprintf_chk vfwprintf_chk fgetws_chk fgetws_u_chk \
+	    confstr_chk getgroups_chk ttyname_r_chk \
+	    gethostname_chk getdomainname_chk wcrtomb_chk mbsnrtowcs_chk \
+	    wcsnrtombs_chk mbsrtowcs_chk wcsrtombs_chk mbstowcs_chk \
+	    wcstombs_chk asprintf_chk vasprintf_chk dprintf_chk \
+	    vdprintf_chk obprintf_chk \
+	    longjmp_chk ____longjmp_chk \
+	    fdelt_chk poll_chk ppoll_chk \
+	    stack_chk_fail fortify_fail \
+	    $(static-only-routines)
+static-only-routines := warning-nop stack_chk_fail_local
+
+CFLAGS-backtrace.c = -fno-omit-frame-pointer
+CFLAGS-sprintf_chk.c = $(libio-mtsafe)
+CFLAGS-snprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsnprintf_chk.c = $(libio-mtsafe)
+CFLAGS-asprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vasprintf_chk.c = $(libio-mtsafe)
+CFLAGS-obprintf_chk.c = $(libio-mtsafe)
+CFLAGS-dprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-vdprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-printf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-vprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-vfprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-gets_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fgets_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fgets_u_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fread_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fread_u_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-swprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vswprintf_chk.c = $(libio-mtsafe)
+CFLAGS-wprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fwprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-vwprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-vfwprintf_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fgetws_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-fgetws_u_chk.c = $(libio-mtsafe) -fexceptions
+CFLAGS-read_chk.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread_chk.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-pread64_chk.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recv_chk.c = -fexceptions -fasynchronous-unwind-tables
+CFLAGS-recvfrom_chk.c = -fexceptions -fasynchronous-unwind-tables
+
+# Need to make sure the settings here override what configure might have
+# set up for us, so keep the CFLAGS/CPPFLAGS split logical as the order is:
+# <user CFLAGS> <test CFLAGS> <user CPPFLAGS> <test CPPFLAGS>
+CFLAGS-tst-longjmp_chk.c = -fexceptions -fasynchronous-unwind-tables
+CPPFLAGS-tst-longjmp_chk.c = -D_FORTIFY_SOURCE=1
+CFLAGS-tst-longjmp_chk2.c = -fexceptions -fasynchronous-unwind-tables
+CPPFLAGS-tst-longjmp_chk2.c = -D_FORTIFY_SOURCE=1
+CFLAGS-tst-longjmp_chk3.c = -fexceptions -fasynchronous-unwind-tables
+CPPFLAGS-tst-longjmp_chk3.c = -D_FORTIFY_SOURCE=1
+
+# We know these tests have problems with format strings, this is what
+# we are testing.  Disable that warning.  They also generate warnings
+# from warning attributes, which cannot be disabled via pragmas, so
+# require -Wno-error to be used.
+CFLAGS-tst-chk1.c = -Wno-format -Wno-error
+CFLAGS-tst-chk2.c = -Wno-format -Wno-error
+CFLAGS-tst-chk3.c = -Wno-format -Wno-error
+CFLAGS-tst-chk4.cc = -Wno-format -Wno-error
+CFLAGS-tst-chk5.cc = -Wno-format -Wno-error
+CFLAGS-tst-chk6.cc = -Wno-format -Wno-error
+CFLAGS-tst-lfschk1.c = -Wno-format -Wno-error
+CFLAGS-tst-lfschk2.c = -Wno-format -Wno-error
+CFLAGS-tst-lfschk3.c = -Wno-format -Wno-error
+CFLAGS-tst-lfschk4.cc = -Wno-format -Wno-error
+CFLAGS-tst-lfschk5.cc = -Wno-format -Wno-error
+CFLAGS-tst-lfschk6.cc = -Wno-format -Wno-error
+LDLIBS-tst-chk4 = -lstdc++
+LDLIBS-tst-chk5 = -lstdc++
+LDLIBS-tst-chk6 = -lstdc++
+LDLIBS-tst-lfschk4 = -lstdc++
+LDLIBS-tst-lfschk5 = -lstdc++
+LDLIBS-tst-lfschk6 = -lstdc++
+
+# backtrace_symbols only works if we link with -rdynamic.  backtrace
+# requires unwind tables on most architectures.
+CFLAGS-tst-backtrace2.c += -funwind-tables
+CFLAGS-tst-backtrace3.c += -funwind-tables
+CFLAGS-tst-backtrace4.c += -funwind-tables
+CFLAGS-tst-backtrace5.c += -funwind-tables
+CFLAGS-tst-backtrace6.c += -funwind-tables
+LDFLAGS-tst-backtrace2 = -rdynamic
+LDFLAGS-tst-backtrace3 = -rdynamic
+LDFLAGS-tst-backtrace4 = -rdynamic
+LDFLAGS-tst-backtrace5 = -rdynamic
+LDFLAGS-tst-backtrace6 = -rdynamic
+
+tests = backtrace-tst tst-longjmp_chk tst-chk1 tst-chk2 tst-chk3 \
+	tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk \
+	tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 \
+	tst-longjmp_chk2 tst-backtrace2 tst-backtrace3 tst-backtrace4 \
+	tst-backtrace5 tst-backtrace6
+
+ifeq (,$(CXX))
+tests-unsupported = tst-chk4 tst-chk5 tst-chk6 \
+		    tst-lfschk4 tst-lfschk5 tst-lfschk6
+endif
+
+extra-libs = libSegFault libpcprofile
+extra-libs-others = $(extra-libs)
+
+libSegFault-routines = segfault
+libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes))
+
+libpcprofile-routines = pcprofile
+libpcprofile-inhibit-o = $(filter-out .os,$(object-suffixes))
+
+others = pcprofiledump
+install-bin = pcprofiledump
+install-bin-script = xtrace
+
+ifeq ($(build-shared),yes)
+install-bin-script += catchsegv
+endif
+generated += catchsegv xtrace
+
+include ../Rules
+
+ifeq ($(run-built-tests),yes)
+LOCALES := de_DE.UTF-8
+include ../gen-locales.mk
+
+$(objpfx)tst-chk1.out: $(gen-locales)
+endif
+
+sLIBdir := $(shell echo $(slibdir) | sed 's,lib\(\|64\)$$,\\\\$$LIB,')
+
+$(objpfx)catchsegv: catchsegv.sh $(common-objpfx)soversions.mk \
+		    $(common-objpfx)config.make
+	slibpfx=`echo $(slibdir)|sed 's/lib\(64\|\)$$/\\\\\\\\$$LIB/'`; \
+	sed -e 's|@VERSION@|$(version)|' -e "s|@SLIB@|$$slibpfx|" \
+	    -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+	    -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $< > $@.new
+	chmod 555 $@.new
+	mv -f $@.new $@
+
+$(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
+
+$(objpfx)xtrace: xtrace.sh
+	rm -f $@.new
+	sed -e 's|@BASH@|$(BASH)|' -e 's|@VERSION@|$(version)|' \
+	    -e 's|@SLIBDIR@|$(sLIBdir)|' -e 's|@BINDIR@|$(bindir)|' \
+	    -e 's|@PKGVERSION@|$(PKGVERSION)|' \
+	    -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
+	&& rm -f $@ && mv $@.new $@ && chmod +x $@
diff --git a/ap/libc/glibc/glibc-2.23/debug/Versions b/ap/libc/glibc/glibc-2.23/debug/Versions
new file mode 100644
index 0000000..0482c85
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/Versions
@@ -0,0 +1,61 @@
+libc {
+  GLIBC_2.1 {
+    # functions used in other libraries
+    __backtrace; __backtrace_symbols; __backtrace_symbols_fd;
+
+    # b*
+    backtrace; backtrace_symbols; backtrace_symbols_fd;
+  }
+  GLIBC_2.2 {
+    # These are to support some gcc features.
+    __cyg_profile_func_enter; __cyg_profile_func_exit;
+  }
+  GLIBC_2.3.4 {
+    __chk_fail;
+    __memcpy_chk; __memmove_chk; __mempcpy_chk; __memset_chk; __stpcpy_chk;
+    __strcat_chk; __strcpy_chk; __strncat_chk; __strncpy_chk;
+    __sprintf_chk; __vsprintf_chk; __snprintf_chk; __vsnprintf_chk;
+    __printf_chk; __fprintf_chk; __vprintf_chk; __vfprintf_chk;
+    __gets_chk;
+  }
+  GLIBC_2.4 {
+    __fgets_chk; __fgets_unlocked_chk;
+    __read_chk; __pread_chk; __pread64_chk;
+    __readlink_chk; __getcwd_chk; __getwd_chk;
+    __recv_chk; __recvfrom_chk;
+    __realpath_chk; __wctomb_chk;
+    __stpncpy_chk;
+    __wcscpy_chk; __wmemcpy_chk; __wmemmove_chk; __wmempcpy_chk; __wcpcpy_chk;
+    __wcsncpy_chk; __wcscat_chk; __wcsncat_chk; __wmemset_chk; __wcpncpy_chk;
+    __swprintf_chk; __vswprintf_chk; __wprintf_chk; __fwprintf_chk;
+    __vwprintf_chk; __vfwprintf_chk; __fgetws_chk; __fgetws_unlocked_chk;
+    __confstr_chk; __getgroups_chk; __ttyname_r_chk;
+    __gethostname_chk; __getdomainname_chk; __wcrtomb_chk; __mbsnrtowcs_chk;
+    __wcsnrtombs_chk; __mbsrtowcs_chk; __wcsrtombs_chk; __mbstowcs_chk;
+    __wcstombs_chk;
+
+    __stack_chk_fail;
+  }
+  GLIBC_2.5 {
+    __readlinkat_chk;
+  }
+  GLIBC_2.7 {
+    __fread_chk; __fread_unlocked_chk;
+  }
+  GLIBC_2.8 {
+    __asprintf_chk; __vasprintf_chk;  __dprintf_chk; __vdprintf_chk;
+    __obstack_printf_chk; __obstack_vprintf_chk;
+  }
+  GLIBC_2.11 {
+    __longjmp_chk;
+  }
+  GLIBC_2.15 {
+    __fdelt_chk; __fdelt_warn;
+  }
+  GLIBC_2.16 {
+    __poll_chk; __ppoll_chk;
+  }
+  GLIBC_PRIVATE {
+    __fortify_fail;
+  }
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/asprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/asprintf_chk.c
new file mode 100644
index 0000000..4e0bf79
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/asprintf_chk.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+
+/* Write formatted output from FORMAT to a string which is
+   allocated with malloc and stored in *STRING_PTR.  */
+int
+__asprintf_chk (char **result_ptr, int flags, const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vasprintf_chk (result_ptr, flags, format, arg);
+  va_end (arg);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/backtrace-tst.c b/ap/libc/glibc/glibc-2.23/debug/backtrace-tst.c
new file mode 100644
index 0000000..cc46c33
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/backtrace-tst.c
@@ -0,0 +1,45 @@
+#include <execinfo.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+
+
+static int
+compare (const void *p1, const void *p2)
+{
+  void *ba[20];
+  int n = backtrace (ba, sizeof (ba) / sizeof (ba[0]));
+  if (n != 0)
+    {
+      char **names = backtrace_symbols (ba, n);
+      if (names != NULL)
+	{
+	  int i;
+	  printf ("called from %s\n", names[0]);
+	  for (i = 1; i < n; ++i)
+	    printf ("            %s\n", names[i]);
+	  free (names);
+	}
+    }
+
+  return *(const uint32_t *) p1 - *(const uint32_t *) p2;
+}
+
+
+int
+main (int argc, char *argv[])
+{
+  uint32_t arr[20];
+  size_t cnt;
+
+  for (cnt = 0; cnt < sizeof (arr) / sizeof (arr[0]); ++cnt)
+    arr[cnt] = random ();
+
+  qsort (arr, sizeof (arr) / sizeof (arr[0]), sizeof (arr[0]), compare);
+
+  for (cnt = 0; cnt < sizeof (arr) / sizeof (arr[0]); ++cnt)
+    printf ("%" PRIx32 "\n", arr[cnt]);
+
+  return 0;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/backtrace.c b/ap/libc/glibc/glibc-2.23/debug/backtrace.c
new file mode 100644
index 0000000..c01b958
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/backtrace.c
@@ -0,0 +1,90 @@
+/* Return backtrace of current program state.  Generic version.
+   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 <execinfo.h>
+#include <signal.h>
+#include <frame.h>
+#include <sigcontextinfo.h>
+#include <ldsodefs.h>
+
+/* This implementation assumes a stack layout that matches the defaults
+   used by gcc's `__builtin_frame_address' and `__builtin_return_address'
+   (FP is the frame pointer register):
+
+	  +-----------------+     +-----------------+
+    FP -> | previous FP --------> | previous FP ------>...
+	  |                 |     |                 |
+	  | return address  |     | return address  |
+	  +-----------------+     +-----------------+
+
+  */
+
+/* Get some notion of the current stack.  Need not be exactly the top
+   of the stack, just something somewhere in the current frame.  */
+#ifndef CURRENT_STACK_FRAME
+# define CURRENT_STACK_FRAME  ({ char __csf; &__csf; })
+#endif
+
+/* By default we assume that the stack grows downward.  */
+#ifndef INNER_THAN
+# define INNER_THAN <
+#endif
+
+/* By default assume the `next' pointer in struct layout points to the
+   next struct layout.  */
+#ifndef ADVANCE_STACK_FRAME
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
+#endif
+
+/* By default, the frame pointer is just what we get from gcc.  */
+#ifndef FIRST_FRAME_POINTER
+# define FIRST_FRAME_POINTER  __builtin_frame_address (0)
+#endif
+
+int
+__backtrace (void **array, int size)
+{
+  struct layout *current;
+  void *top_frame;
+  void *top_stack;
+  int cnt = 0;
+
+  top_frame = FIRST_FRAME_POINTER;
+  top_stack = CURRENT_STACK_FRAME;
+
+  /* We skip the call to this function, it makes no sense to record it.  */
+  current = ((struct layout *) top_frame);
+  while (cnt < size)
+    {
+      if ((void *) current INNER_THAN top_stack
+	  || !((void *) current INNER_THAN __libc_stack_end))
+       /* This means the address is out of range.  Note that for the
+	  toplevel we see a frame pointer with value NULL which clearly is
+	  out of range.  */
+	break;
+
+      array[cnt++] = current->return_address;
+
+      current = ADVANCE_STACK_FRAME (current->next);
+    }
+
+  return cnt;
+}
+weak_alias (__backtrace, backtrace)
+libc_hidden_def (__backtrace)
diff --git a/ap/libc/glibc/glibc-2.23/debug/backtracesyms.c b/ap/libc/glibc/glibc-2.23/debug/backtracesyms.c
new file mode 100644
index 0000000..ff587ee
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/backtracesyms.c
@@ -0,0 +1,120 @@
+/* Return list with names for address in backtrace.
+   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 <assert.h>
+#include <execinfo.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <ldsodefs.h>
+
+#if __ELF_NATIVE_CLASS == 32
+# define WORD_WIDTH 8
+#else
+/* We assume 64bits.  */
+# define WORD_WIDTH 16
+#endif
+
+
+char **
+__backtrace_symbols (void *const *array, int size)
+{
+  Dl_info info[size];
+  int status[size];
+  int cnt;
+  size_t total = 0;
+  char **result;
+
+  /* Fill in the information we can get from `dladdr'.  */
+  for (cnt = 0; cnt < size; ++cnt)
+    {
+      struct link_map *map;
+      status[cnt] = _dl_addr (array[cnt], &info[cnt], &map, NULL);
+      if (status[cnt] && info[cnt].dli_fname && info[cnt].dli_fname[0] != '\0')
+	{
+	  /* We have some info, compute the length of the string which will be
+	     "<file-name>(<sym-name>+offset) [address].  */
+	  total += (strlen (info[cnt].dli_fname ?: "")
+		    + strlen (info[cnt].dli_sname ?: "")
+		    + 3 + WORD_WIDTH + 3 + WORD_WIDTH + 5);
+
+	  /* The load bias is more useful to the user than the load
+	     address.  The use of these addresses is to calculate an
+	     address in the ELF file, so its prelinked bias is not
+	     something we want to subtract out.  */
+	  info[cnt].dli_fbase = (void *) map->l_addr;
+	}
+      else
+	total += 5 + WORD_WIDTH;
+    }
+
+  /* Allocate memory for the result.  */
+  result = (char **) malloc (size * sizeof (char *) + total);
+  if (result != NULL)
+    {
+      char *last = (char *) (result + size);
+
+      for (cnt = 0; cnt < size; ++cnt)
+	{
+	  result[cnt] = last;
+
+	  if (status[cnt]
+	      && info[cnt].dli_fname != NULL && info[cnt].dli_fname[0] != '\0')
+	    {
+	      if (info[cnt].dli_sname == NULL)
+		/* We found no symbol name to use, so describe it as
+		   relative to the file.  */
+		info[cnt].dli_saddr = info[cnt].dli_fbase;
+
+	      if (info[cnt].dli_sname == NULL && info[cnt].dli_saddr == 0)
+		last += 1 + sprintf (last, "%s(%s) [%p]",
+				     info[cnt].dli_fname ?: "",
+				     info[cnt].dli_sname ?: "",
+				     array[cnt]);
+	      else
+		{
+		  char sign;
+		  ptrdiff_t offset;
+		  if (array[cnt] >= (void *) info[cnt].dli_saddr)
+		    {
+		      sign = '+';
+		      offset = array[cnt] - info[cnt].dli_saddr;
+		    }
+		  else
+		    {
+		      sign = '-';
+		      offset = info[cnt].dli_saddr - array[cnt];
+		    }
+
+		  last += 1 + sprintf (last, "%s(%s%c%#tx) [%p]",
+				       info[cnt].dli_fname ?: "",
+				       info[cnt].dli_sname ?: "",
+				       sign, offset, array[cnt]);
+		}
+	    }
+	  else
+	    last += 1 + sprintf (last, "[%p]", array[cnt]);
+	}
+      assert (last <= (char *) result + size * sizeof (char *) + total);
+    }
+
+  return result;
+}
+weak_alias (__backtrace_symbols, backtrace_symbols)
diff --git a/ap/libc/glibc/glibc-2.23/debug/backtracesymsfd.c b/ap/libc/glibc/glibc-2.23/debug/backtracesymsfd.c
new file mode 100644
index 0000000..9c58f80
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/backtracesymsfd.c
@@ -0,0 +1,122 @@
+/* Write formatted list with names for addresses in backtrace to a file.
+   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 <execinfo.h>
+#include <string.h>
+#include <sys/uio.h>
+
+#include <_itoa.h>
+#include <ldsodefs.h>
+
+#if __ELF_NATIVE_CLASS == 32
+# define WORD_WIDTH 8
+#else
+/* We assume 64bits.  */
+# define WORD_WIDTH 16
+#endif
+
+
+void
+__backtrace_symbols_fd (void *const *array, int size, int fd)
+{
+  struct iovec iov[9];
+  int cnt;
+
+  for (cnt = 0; cnt < size; ++cnt)
+    {
+      char buf[WORD_WIDTH];
+      char buf2[WORD_WIDTH];
+      Dl_info info;
+      struct link_map *map;
+      size_t last = 0;
+
+      if (_dl_addr (array[cnt], &info, &map, NULL)
+	  && info.dli_fname != NULL && info.dli_fname[0] != '\0')
+	{
+	  /* Name of the file.  */
+	  iov[0].iov_base = (void *) info.dli_fname;
+	  iov[0].iov_len = strlen (info.dli_fname);
+	  last = 1;
+
+	  if (info.dli_sname != NULL || map->l_addr != 0)
+	    {
+	      size_t diff;
+
+	      iov[last].iov_base = (void *) "(";
+	      iov[last].iov_len = 1;
+	      ++last;
+
+	      if (info.dli_sname != NULL)
+		{
+		  /* We have a symbol name.  */
+		  iov[last].iov_base = (void *) info.dli_sname;
+		  iov[last].iov_len = strlen (info.dli_sname);
+		  ++last;
+		}
+	      else
+		/* We have no symbol, so describe it as relative to the file.
+		   The load bias is more useful to the user than the load
+		   address.  The use of these addresses is to calculate an
+		   address in the ELF file, so its prelinked bias is not
+		   something we want to subtract out.  */
+		info.dli_saddr = (void *) map->l_addr;
+
+	      if (array[cnt] >= (void *) info.dli_saddr)
+		{
+		  iov[last].iov_base = (void *) "+0x";
+		  diff = array[cnt] - info.dli_saddr;
+		}
+	      else
+		{
+		  iov[last].iov_base = (void *) "-0x";
+		  diff = info.dli_saddr - array[cnt];
+		}
+	      iov[last].iov_len = 3;
+	      ++last;
+
+	      iov[last].iov_base = _itoa_word ((unsigned long int) diff,
+					       &buf2[WORD_WIDTH], 16, 0);
+	      iov[last].iov_len = (&buf2[WORD_WIDTH]
+				   - (char *) iov[last].iov_base);
+	      ++last;
+
+	      iov[last].iov_base = (void *) ")";
+	      iov[last].iov_len = 1;
+	      ++last;
+	    }
+	}
+
+      iov[last].iov_base = (void *) "[0x";
+      iov[last].iov_len = 3;
+      ++last;
+
+      iov[last].iov_base = _itoa_word ((unsigned long int) array[cnt],
+				       &buf[WORD_WIDTH], 16, 0);
+      iov[last].iov_len = &buf[WORD_WIDTH] - (char *) iov[last].iov_base;
+      ++last;
+
+      iov[last].iov_base = (void *) "]\n";
+      iov[last].iov_len = 2;
+      ++last;
+
+      __writev (fd, iov, last);
+    }
+}
+weak_alias (__backtrace_symbols_fd, backtrace_symbols_fd)
+libc_hidden_def (__backtrace_symbols_fd)
diff --git a/ap/libc/glibc/glibc-2.23/debug/catchsegv.sh b/ap/libc/glibc/glibc-2.23/debug/catchsegv.sh
new file mode 100755
index 0000000..3c788d2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/catchsegv.sh
@@ -0,0 +1,107 @@
+#!/bin/sh
+# Copyright (C) 1998-2016 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+# 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 test $# -eq 0; then
+  echo "$0: missing program name" >&2
+  echo "Try \`$0 --help' for more information." >&2
+  exit 1
+fi
+
+prog="$1"
+shift
+
+if test $# -eq 0; then
+  case "$prog" in
+    --h | --he | --hel | --help)
+      echo 'Usage: catchsegv PROGRAM ARGS...'
+      echo '  --help      print this help, then exit'
+      echo '  --version   print version number, then exit'
+      echo 'For bug reporting instructions, please see:'
+      cat <<\EOF
+@REPORT_BUGS_TO@.
+EOF
+      exit 0
+      ;;
+    --v | --ve | --ver | --vers | --versi | --versio | --version)
+      echo 'catchsegv @PKGVERSION@@VERSION@'
+      echo 'Copyright (C) 2016 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+Written by Ulrich Drepper.'
+      exit 0
+      ;;
+    *)
+      ;;
+  esac
+fi
+
+segv_output=`mktemp ${TMPDIR:-/tmp}/segv_output.XXXXXX` || exit
+
+# Redirect stderr to avoid termination message from shell.
+(exec 3>&2 2>/dev/null
+LD_PRELOAD=${LD_PRELOAD:+${LD_PRELOAD}:}@SLIB@/libSegFault.so \
+SEGFAULT_USE_ALTSTACK=1 \
+SEGFAULT_OUTPUT_NAME=$segv_output \
+"$prog" ${1+"$@"} 2>&3 3>&-)
+exval=$?
+
+# Check for output.  Even if the program terminated correctly it might
+# be that a minor process (clone) failed.  Therefore we do not check the
+# exit code.
+if test -s "$segv_output"; then
+  # The program caught a signal.  The output is in the file with the
+  # name we have in SEGFAULT_OUTPUT_NAME.  In the output the names of
+  # functions in shared objects are available, but names in the static
+  # part of the program are not.  We use addr2line to get this information.
+  case $prog in
+  */*) ;;
+  *)
+    old_IFS=$IFS
+    IFS=:
+    for p in $PATH; do
+      test -n "$p" || p=.
+      if test -f "$p/$prog"; then
+	prog=$p/$prog
+      break
+      fi
+    done
+    IFS=$old_IFS
+    ;;
+  esac
+  sed '/Backtrace/q' "$segv_output"
+  sed '1,/Backtrace/d' "$segv_output" |
+  (while read line; do
+     line=`echo $line | sed "s@^$prog\\(\\[.*\\)@\1@"`
+     case "$line" in
+       \[*) addr=`echo "$line" | sed 's/^\[\(.*\)\]$/\1/'`
+	    complete=`addr2line -f -e "$prog" $addr 2>/dev/null`
+	    if test $? -eq 0; then
+	      echo "`echo "$complete"|sed 'N;s/\(.*\)\n\(.*\)/\2(\1)/;'`$line"
+	    else
+	      echo "$line"
+	    fi
+	    ;;
+	 *) echo "$line"
+	    ;;
+     esac
+   done)
+fi
+rm -f "$segv_output"
+
+exit $exval
diff --git a/ap/libc/glibc/glibc-2.23/debug/chk_fail.c b/ap/libc/glibc/glibc-2.23/debug/chk_fail.c
new file mode 100644
index 0000000..de5a833
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/chk_fail.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2004-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/>.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+extern char **__libc_argv attribute_hidden;
+
+void
+__attribute__ ((noreturn))
+__chk_fail (void)
+{
+  __fortify_fail ("buffer overflow detected");
+}
+libc_hidden_def (__chk_fail)
diff --git a/ap/libc/glibc/glibc-2.23/debug/confstr_chk.c b/ap/libc/glibc/glibc-2.23/debug/confstr_chk.c
new file mode 100644
index 0000000..bfe7d14
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/confstr_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@readhat.com>, 20055.
+
+   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>
+
+
+size_t
+__confstr_chk (int name, char *buf, size_t len, size_t buflen)
+{
+  if (__glibc_unlikely (buflen < len))
+    __chk_fail ();
+
+  return confstr (name, buf, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/dprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/dprintf_chk.c
new file mode 100644
index 0000000..750b981
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/dprintf_chk.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+
+/* Write formatted output to D, according to the format string FORMAT.  */
+int
+__dprintf_chk (int d, int flags, const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vdprintf_chk (d, flags, format, arg);
+  va_end (arg);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/execinfo.h b/ap/libc/glibc/glibc-2.23/debug/execinfo.h
new file mode 100644
index 0000000..d47c9e6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/execinfo.h
@@ -0,0 +1,43 @@
+/* Copyright (C) 1998-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/>.  */
+
+#ifndef _EXECINFO_H
+#define _EXECINFO_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Store up to SIZE return address of the current program state in
+   ARRAY and return the exact number of values stored.  */
+extern int backtrace (void **__array, int __size) __nonnull ((1));
+
+
+/* Return names of functions from the backtrace list in ARRAY in a newly
+   malloc()ed memory block.  */
+extern char **backtrace_symbols (void *const *__array, int __size)
+     __THROW __nonnull ((1));
+
+
+/* This function is similar to backtrace_symbols() but it writes the result
+   immediately to a file.  */
+extern void backtrace_symbols_fd (void *const *__array, int __size, int __fd)
+     __THROW __nonnull ((1));
+
+__END_DECLS
+
+#endif /* execinfo.h  */
diff --git a/ap/libc/glibc/glibc-2.23/debug/fdelt_chk.c b/ap/libc/glibc/glibc-2.23/debug/fdelt_chk.c
new file mode 100644
index 0000000..7fe243d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fdelt_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 2011-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/>.  */
+
+#include <sys/select.h>
+
+
+long int
+__fdelt_chk (long int d)
+{
+  if (d < 0 || d >= FD_SETSIZE)
+    __chk_fail ();
+
+  return d / __NFDBITS;
+}
+strong_alias (__fdelt_chk, __fdelt_warn)
diff --git a/ap/libc/glibc/glibc-2.23/debug/fgets_chk.c b/ap/libc/glibc/glibc-2.23/debug/fgets_chk.c
new file mode 100644
index 0000000..6d396f9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fgets_chk.c
@@ -0,0 +1,61 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "libioP.h"
+#include <stdio.h>
+#include <sys/param.h>
+
+char *
+__fgets_chk (char *buf, size_t size, int n, _IO_FILE *fp)
+{
+  _IO_size_t count;
+  char *result;
+  CHECK_FILE (fp, NULL);
+  if (n <= 0)
+    return NULL;
+  _IO_acquire_lock (fp);
+  /* This is very tricky since a file descriptor may be in the
+     non-blocking mode. The error flag doesn't mean much in this
+     case. We return an error only when there is a new error. */
+  int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
+  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
+  /* If we read in some bytes and errno is EAGAIN, that error will
+     be reported for next read. */
+  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
+		     && errno != EAGAIN))
+    result = NULL;
+  else if (count >= size)
+    __chk_fail ();
+  else
+    {
+      buf[count] = '\0';
+      result = buf;
+    }
+  fp->_IO_file_flags |= old_error;
+  _IO_release_lock (fp);
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fgets_u_chk.c b/ap/libc/glibc/glibc-2.23/debug/fgets_u_chk.c
new file mode 100644
index 0000000..99766fe
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fgets_u_chk.c
@@ -0,0 +1,59 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "libioP.h"
+#include <stdio.h>
+#include <sys/param.h>
+
+char *
+__fgets_unlocked_chk (char *buf, size_t size, int n, _IO_FILE *fp)
+{
+  _IO_size_t count;
+  char *result;
+  CHECK_FILE (fp, NULL);
+  if (n <= 0)
+    return NULL;
+  /* This is very tricky since a file descriptor may be in the
+     non-blocking mode. The error flag doesn't mean much in this
+     case. We return an error only when there is a new error. */
+  int old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
+  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  count = _IO_getline (fp, buf, MIN ((size_t) n - 1, size), '\n', 1);
+  /* If we read in some bytes and errno is EAGAIN, that error will
+     be reported for next read. */
+  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
+		     && errno != EAGAIN))
+    result = NULL;
+  else if (count >= size)
+    __chk_fail ();
+  else
+    {
+      buf[count] = '\0';
+      result = buf;
+    }
+  fp->_IO_file_flags |= old_error;
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fgetws_chk.c b/ap/libc/glibc/glibc-2.23/debug/fgetws_chk.c
new file mode 100644
index 0000000..a3b7b82
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fgetws_chk.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1993-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/>.  */
+
+#include "libioP.h"
+#include <wchar.h>
+#include <sys/param.h>
+
+wchar_t *
+__fgetws_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
+{
+  _IO_size_t count;
+  wchar_t *result;
+  int old_error;
+  CHECK_FILE (fp, NULL);
+  if (n <= 0)
+    return NULL;
+  _IO_acquire_lock (fp);
+  /* This is very tricky since a file descriptor may be in the
+     non-blocking mode. The error flag doesn't mean much in this
+     case. We return an error only when there is a new error. */
+  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
+  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
+  /* If we read in some bytes and errno is EAGAIN, that error will
+     be reported for next read. */
+  if (count == 0 || (_IO_ferror_unlocked (fp) && errno != EAGAIN))
+    result = NULL;
+  else if (count >= size)
+    __chk_fail ();
+  else
+    {
+      buf[count] = '\0';
+      result = buf;
+    }
+  fp->_IO_file_flags |= old_error;
+  _IO_release_lock (fp);
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fgetws_u_chk.c b/ap/libc/glibc/glibc-2.23/debug/fgetws_u_chk.c
new file mode 100644
index 0000000..caa568c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fgetws_u_chk.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "libioP.h"
+#include <wchar.h>
+#include <sys/param.h>
+
+wchar_t *
+__fgetws_unlocked_chk (wchar_t *buf, size_t size, int n, _IO_FILE *fp)
+{
+  _IO_size_t count;
+  wchar_t *result;
+  int old_error;
+  CHECK_FILE (fp, NULL);
+  if (n <= 0)
+    return NULL;
+  /* This is very tricky since a file descriptor may be in the
+     non-blocking mode. The error flag doesn't mean much in this
+     case. We return an error only when there is a new error. */
+  old_error = fp->_IO_file_flags & _IO_ERR_SEEN;
+  fp->_IO_file_flags &= ~_IO_ERR_SEEN;
+  count = _IO_getwline (fp, buf, MIN ((size_t) n - 1, size), L'\n', 1);
+  /* If we read in some bytes and errno is EAGAIN, that error will
+     be reported for next read. */
+  if (count == 0 || ((fp->_IO_file_flags & _IO_ERR_SEEN)
+		     && errno != EAGAIN))
+    result = NULL;
+  else if (count >= size)
+    __chk_fail ();
+  else
+    {
+      buf[count] = '\0';
+      result = buf;
+    }
+  fp->_IO_file_flags |= old_error;
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fortify_fail.c b/ap/libc/glibc/glibc-2.23/debug/fortify_fail.c
new file mode 100644
index 0000000..7198077
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fortify_fail.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2007-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/>.  */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+
+extern char **__libc_argv attribute_hidden;
+
+void
+__attribute__ ((noreturn)) internal_function
+__fortify_fail (const char *msg)
+{
+  /* The loop is added only to keep gcc happy.  */
+  while (1)
+    __libc_message (2, "*** %s ***: %s terminated\n",
+		    msg, __libc_argv[0] ?: "<unknown>");
+}
+libc_hidden_def (__fortify_fail)
diff --git a/ap/libc/glibc/glibc-2.23/debug/fprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/fprintf_chk.c
new file mode 100644
index 0000000..0dd9ad6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fprintf_chk.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to FP from the format string FORMAT.  */
+int
+___fprintf_chk (FILE *fp, int flag, const char *format, ...)
+{
+  va_list ap;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (fp);
+  if (flag > 0)
+    fp->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  va_start (ap, format);
+  done = vfprintf (fp, format, ap);
+  va_end (ap);
+
+  if (flag > 0)
+    fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (fp);
+
+  return done;
+}
+ldbl_strong_alias (___fprintf_chk, __fprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/fread_chk.c b/ap/libc/glibc/glibc-2.23/debug/fread_chk.c
new file mode 100644
index 0000000..ee88d37
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fread_chk.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "libioP.h"
+#include <stdio.h>
+
+size_t
+__fread_chk (void *__restrict ptr, size_t ptrlen,
+	     size_t size, size_t n, FILE *__restrict stream)
+{
+  size_t bytes_requested = size * n;
+  if (__builtin_expect ((n | size)
+			>= (((size_t) 1) << (8 * sizeof (size_t) / 2)), 0))
+    {
+      if (size != 0 && bytes_requested / size != n)
+	__chk_fail ();
+    }
+
+  if (__glibc_unlikely (bytes_requested > ptrlen))
+    __chk_fail ();
+
+  CHECK_FILE (stream, 0);
+  if (bytes_requested == 0)
+    return 0;
+
+  size_t bytes_read;
+  _IO_acquire_lock (stream);
+  bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
+  _IO_release_lock (stream);
+  return bytes_requested == bytes_read ? n : bytes_read / size;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fread_u_chk.c b/ap/libc/glibc/glibc-2.23/debug/fread_u_chk.c
new file mode 100644
index 0000000..1b2dbd4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fread_u_chk.c
@@ -0,0 +1,51 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "libioP.h"
+#include <stdio.h>
+
+size_t
+__fread_unlocked_chk (void *__restrict ptr, size_t ptrlen,
+		      size_t size, size_t n, FILE *__restrict stream)
+{
+  size_t bytes_requested = size * n;
+  if (__builtin_expect ((n | size)
+			>= (((size_t) 1) << (8 * sizeof (size_t) / 2)), 0))
+    {
+      if (size != 0 && bytes_requested / size != n)
+	__chk_fail ();
+    }
+
+  if (__glibc_unlikely (bytes_requested > ptrlen))
+    __chk_fail ();
+
+  CHECK_FILE (stream, 0);
+  if (bytes_requested == 0)
+    return 0;
+
+  size_t bytes_read = _IO_sgetn (stream, (char *) ptr, bytes_requested);
+  return bytes_requested == bytes_read ? n : bytes_read / size;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/fwprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/fwprintf_chk.c
new file mode 100644
index 0000000..1318492
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/fwprintf_chk.c
@@ -0,0 +1,43 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <wchar.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to FP from the format string FORMAT.  */
+int
+__fwprintf_chk (FILE *fp, int flag, const wchar_t *format, ...)
+{
+  va_list ap;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (fp);
+  if (flag > 0)
+    fp->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  va_start (ap, format);
+  done = _IO_vfwprintf (fp, format, ap);
+  va_end (ap);
+
+  if (flag > 0)
+    fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (fp);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/getcwd_chk.c b/ap/libc/glibc/glibc-2.23/debug/getcwd_chk.c
new file mode 100644
index 0000000..7451f1a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/getcwd_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <errno.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+
+char *
+__getcwd_chk (char *buf, size_t size, size_t buflen)
+{
+  if (size > buflen)
+    __chk_fail ();
+
+  return __getcwd (buf, size);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/getdomainname_chk.c b/ap/libc/glibc/glibc-2.23/debug/getdomainname_chk.c
new file mode 100644
index 0000000..cc9afda
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/getdomainname_chk.c
@@ -0,0 +1,28 @@
+/* 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
+   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>
+
+
+int
+__getdomainname_chk (char *buf, size_t buflen, size_t nreal)
+{
+  if (buflen > nreal)
+    __chk_fail ();
+
+  return getdomainname (buf, buflen);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/getgroups_chk.c b/ap/libc/glibc/glibc-2.23/debug/getgroups_chk.c
new file mode 100644
index 0000000..e5c4bac
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/getgroups_chk.c
@@ -0,0 +1,35 @@
+/* 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
+   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 <errno.h>
+#include <unistd.h>
+
+
+int
+__getgroups_chk (int size, __gid_t list[], size_t listlen)
+{
+  if (__glibc_unlikely (size < 0))
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  if (__glibc_unlikely (size * sizeof (__gid_t) > listlen))
+    __chk_fail ();
+
+  return __getgroups (size, list);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/gethostname_chk.c b/ap/libc/glibc/glibc-2.23/debug/gethostname_chk.c
new file mode 100644
index 0000000..7ef3475
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/gethostname_chk.c
@@ -0,0 +1,28 @@
+/* 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
+   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>
+
+
+int
+__gethostname_chk (char *buf, size_t buflen, size_t nreal)
+{
+  if (buflen > nreal)
+    __chk_fail ();
+
+  return __gethostname (buf, buflen);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/gets_chk.c b/ap/libc/glibc/glibc-2.23/debug/gets_chk.c
new file mode 100644
index 0000000..aebc9eb
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/gets_chk.c
@@ -0,0 +1,75 @@
+/* Copyright (C) 1993-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include "../libio/libioP.h"
+#include <limits.h>
+
+char *
+__gets_chk (char *buf, size_t size)
+{
+  _IO_size_t count;
+  int ch;
+  char *retval;
+
+  if (size == 0)
+    __chk_fail ();
+
+  _IO_acquire_lock (_IO_stdin);
+  ch = _IO_getc_unlocked (_IO_stdin);
+  if (ch == EOF)
+    {
+      retval = NULL;
+      goto unlock_return;
+    }
+  if (ch == '\n')
+    count = 0;
+  else
+    {
+      /* This is very tricky since a file descriptor may be in the
+	 non-blocking mode. The error flag doesn't mean much in this
+	 case. We return an error only when there is a new error. */
+      int old_error = _IO_stdin->_IO_file_flags & _IO_ERR_SEEN;
+      _IO_stdin->_IO_file_flags &= ~_IO_ERR_SEEN;
+      buf[0] = (char) ch;
+      count = _IO_getline (_IO_stdin, buf + 1, size - 1, '\n', 0) + 1;
+      if (_IO_stdin->_IO_file_flags & _IO_ERR_SEEN)
+	{
+	  retval = NULL;
+	  goto unlock_return;
+	}
+      else
+	_IO_stdin->_IO_file_flags |= old_error;
+    }
+  if (count >= size)
+    __chk_fail ();
+  buf[count] = 0;
+  retval = buf;
+unlock_return:
+  _IO_release_lock (_IO_stdin);
+  return retval;
+}
+
+link_warning (__gets_chk, "the `gets' function is dangerous and should not be used.")
diff --git a/ap/libc/glibc/glibc-2.23/debug/getwd_chk.c b/ap/libc/glibc/glibc-2.23/debug/getwd_chk.c
new file mode 100644
index 0000000..809b54d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/getwd_chk.c
@@ -0,0 +1,33 @@
+/* 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
+   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 <errno.h>
+#include <unistd.h>
+#include <sys/param.h>
+
+
+char *
+__getwd_chk (char *buf, size_t buflen)
+{
+  char *res = __getcwd (buf, buflen);
+  if (res == NULL && errno == ERANGE)
+    __chk_fail ();
+  return res;
+}
+
+link_warning (getwd,
+	      "the `getwd' function is dangerous and should not be used.")
diff --git a/ap/libc/glibc/glibc-2.23/debug/longjmp_chk.c b/ap/libc/glibc/glibc-2.23/debug/longjmp_chk.c
new file mode 100644
index 0000000..4accb4c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/longjmp_chk.c
@@ -0,0 +1,27 @@
+/* Copyright (C) 2009-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/>.  */
+
+#include <setjmp.h>
+
+// XXX Should move to include/setjmp.h
+extern void ____longjmp_chk (__jmp_buf __env, int __val)
+     __attribute__ ((__noreturn__));
+
+#define __longjmp ____longjmp_chk
+#define __libc_siglongjmp __longjmp_chk
+
+#include <setjmp/longjmp.c>
diff --git a/ap/libc/glibc/glibc-2.23/debug/mbsnrtowcs_chk.c b/ap/libc/glibc/glibc-2.23/debug/mbsnrtowcs_chk.c
new file mode 100644
index 0000000..3b14f3a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/mbsnrtowcs_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <locale.h>
+#include <wchar.h>
+
+
+size_t
+__mbsnrtowcs_chk (wchar_t *dst, const char **src, size_t nmc, size_t len,
+		  mbstate_t *ps, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return __mbsnrtowcs (dst, src, nmc, len, ps);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/mbsrtowcs_chk.c b/ap/libc/glibc/glibc-2.23/debug/mbsrtowcs_chk.c
new file mode 100644
index 0000000..b10ba19
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/mbsrtowcs_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <locale.h>
+#include <wchar.h>
+
+
+size_t
+__mbsrtowcs_chk (wchar_t *dst, const char **src, size_t len,
+		 mbstate_t *ps, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return __mbsrtowcs (dst, src, len, ps);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/mbstowcs_chk.c b/ap/libc/glibc/glibc-2.23/debug/mbstowcs_chk.c
new file mode 100644
index 0000000..ee75aae
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/mbstowcs_chk.c
@@ -0,0 +1,34 @@
+/* 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
+   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 <locale.h>
+#include <string.h>
+#include <wchar.h>
+
+
+size_t
+__mbstowcs_chk (wchar_t *dst, const char *src, size_t len, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  mbstate_t state;
+
+  memset (&state, '\0', sizeof state);
+  /* Return how many we wrote (or maybe an error).  */
+  return __mbsrtowcs (dst, &src, len, &state);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/memcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/memcpy_chk.c
new file mode 100644
index 0000000..04a1337
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/memcpy_chk.c
@@ -0,0 +1,31 @@
+/* Copy memory to memory until the specified number of bytes
+   has been copied with error checking.  Overlap is NOT handled correctly.
+   Copyright (C) 1991-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Torbjorn Granlund (tege@sics.se).
+
+   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 <string.h>
+#include <memcopy.h>
+
+void *
+__memcpy_chk (void *dstpp, const void *srcpp, size_t len, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return memcpy (dstpp, srcpp, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/memmove_chk.c b/ap/libc/glibc/glibc-2.23/debug/memmove_chk.c
new file mode 100644
index 0000000..8e61c8e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/memmove_chk.c
@@ -0,0 +1,35 @@
+/* Copy memory to memory until the specified number of bytes
+   has been copied with error checking.  Overlap is handled correctly.
+   Copyright (C) 1991-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Torbjorn Granlund (tege@sics.se).
+
+   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 <string.h>
+#include <memcopy.h>
+
+#ifndef MEMMOVE_CHK
+# define MEMMOVE_CHK __memmove_chk
+#endif
+
+void *
+MEMMOVE_CHK (void *dest, const void *src, size_t len, size_t destlen)
+{
+  if (__glibc_unlikely (destlen < len))
+    __chk_fail ();
+
+  return memmove (dest, src, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/mempcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/mempcpy_chk.c
new file mode 100644
index 0000000..0dc1ab6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/mempcpy_chk.c
@@ -0,0 +1,32 @@
+/* Copy memory to memory until the specified number of bytes
+   has been copied, return pointer to following byte, with error checking.
+   Overlap is NOT handled correctly.
+   Copyright (C) 1991-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Torbjorn Granlund (tege@sics.se).
+
+   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 <string.h>
+#include <memcopy.h>
+
+void *
+__mempcpy_chk (void *dstpp, const void *srcpp, size_t len, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return __mempcpy (dstpp, srcpp, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/memset_chk.c b/ap/libc/glibc/glibc-2.23/debug/memset_chk.c
new file mode 100644
index 0000000..ef437ef
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/memset_chk.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <string.h>
+#include <memcopy.h>
+
+void *
+__memset_chk (void *dstpp, int c, size_t len, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return memset (dstpp, c, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/noophooks.c b/ap/libc/glibc/glibc-2.23/debug/noophooks.c
new file mode 100644
index 0000000..e9a7fbc
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/noophooks.c
@@ -0,0 +1,26 @@
+/* Noop hooks for the instrumenting functions.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+   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 <libc-internal.h>
+
+void
+__cyg_profile_func_enter (void *this_fn, void *call_site)
+{
+}
+strong_alias (__cyg_profile_func_enter, __cyg_profile_func_exit)
diff --git a/ap/libc/glibc/glibc-2.23/debug/obprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/obprintf_chk.c
new file mode 100644
index 0000000..8469b5f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/obprintf_chk.c
@@ -0,0 +1,115 @@
+/* Print output of stream to given obstack.
+   Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+   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 <stdlib.h>
+#include <libioP.h>
+#include "../libio/strfile.h"
+#include <assert.h>
+#include <string.h>
+#include <errno.h>
+#include <obstack.h>
+#include <stdarg.h>
+#include <stdio_ext.h>
+
+
+struct _IO_obstack_file
+{
+  struct _IO_FILE_plus file;
+  struct obstack *obstack;
+};
+
+extern const struct _IO_jump_t _IO_obstack_jumps attribute_hidden;
+
+int
+__obstack_vprintf_chk (struct obstack *obstack, int flags, const char *format,
+		       va_list args)
+{
+  struct obstack_FILE
+    {
+      struct _IO_obstack_file ofile;
+    } new_f;
+  int result;
+  int size;
+  int room;
+
+#ifdef _IO_MTSAFE_IO
+  new_f.ofile.file.file._lock = NULL;
+#endif
+
+  _IO_no_init (&new_f.ofile.file.file, _IO_USER_LOCK, -1, NULL, NULL);
+  _IO_JUMPS (&new_f.ofile.file) = &_IO_obstack_jumps;
+  room = obstack_room (obstack);
+  size = obstack_object_size (obstack) + room;
+  if (size == 0)
+    {
+      /* We have to handle the allocation a bit different since the
+	 `_IO_str_init_static' function would handle a size of zero
+	 different from what we expect.  */
+
+      /* Get more memory.  */
+      obstack_make_room (obstack, 64);
+
+      /* Recompute how much room we have.  */
+      room = obstack_room (obstack);
+      size = room;
+
+      assert (size != 0);
+    }
+
+  _IO_str_init_static_internal ((struct _IO_strfile_ *) &new_f.ofile,
+				obstack_base (obstack),
+				size, obstack_next_free (obstack));
+  /* Now allocate the rest of the current chunk.  */
+  assert (size == (new_f.ofile.file.file._IO_write_end
+		   - new_f.ofile.file.file._IO_write_base));
+  assert (new_f.ofile.file.file._IO_write_ptr
+	  == (new_f.ofile.file.file._IO_write_base
+	      + obstack_object_size (obstack)));
+  obstack_blank_fast (obstack, room);
+
+  new_f.ofile.obstack = obstack;
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    new_f.ofile.file.file._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  result = _IO_vfprintf (&new_f.ofile.file.file, format, args);
+
+  /* Shrink the buffer to the space we really currently need.  */
+  obstack_blank_fast (obstack, (new_f.ofile.file.file._IO_write_ptr
+				- new_f.ofile.file.file._IO_write_end));
+
+  return result;
+}
+libc_hidden_def (__obstack_vprintf_chk)
+
+
+int
+__obstack_printf_chk (struct obstack *obstack, int flags, const char *format,
+		      ...)
+{
+  int result;
+  va_list ap;
+  va_start (ap, format);
+  result = __obstack_vprintf_chk (obstack, flags, format, ap);
+  va_end (ap);
+  return result;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/pcprofile.c b/ap/libc/glibc/glibc-2.23/debug/pcprofile.c
new file mode 100644
index 0000000..5112e2b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/pcprofile.c
@@ -0,0 +1,92 @@
+/* Profile PC and write result to FIFO.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+   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 <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <libc-internal.h>
+
+/* Nonzero if we are actually doing something.  */
+static int active;
+
+/* The file descriptor of the FIFO.  */
+static int fd;
+
+
+static void
+__attribute__ ((constructor))
+install (void)
+{
+  /* See whether the environment variable `PCPROFILE_OUTPUT' is defined.
+     If yes, it should name a FIFO.  We open it and mark ourself as active.  */
+  const char *outfile = getenv ("PCPROFILE_OUTPUT");
+
+  if (outfile != NULL && *outfile != '\0')
+    {
+      fd = open (outfile, O_RDWR | O_CREAT, 0666);
+
+      if (fd != -1)
+	{
+	  uint32_t word;
+
+	  active = 1;
+
+	  /* Write a magic word which tells the reader about the byte
+	     order and the size of the following entries.  */
+	  word = 0xdeb00000 | sizeof (void *);
+	  if (TEMP_FAILURE_RETRY (write (fd, &word, 4)) != 4)
+	    {
+	      /* If even this fails we shouldn't try further.  */
+	      close (fd);
+	      fd = -1;
+	      active = 0;
+	    }
+	}
+    }
+}
+
+
+static void
+__attribute__ ((destructor))
+uninstall (void)
+{
+  if (active)
+    close (fd);
+}
+
+
+void
+__cyg_profile_func_enter (void *this_fn, void *call_site)
+{
+  void *buf[2];
+
+  if (! active)
+    return;
+
+  /* Now write out the current position and that of the caller.  We do
+     this now, and don't cache the because we want real-time output.  */
+  buf[0] = this_fn;
+  buf[1] = call_site;
+
+  write (fd, buf, sizeof buf);
+}
+/* We don't handle entry and exit differently here.  */
+strong_alias (__cyg_profile_func_enter, __cyg_profile_func_exit)
diff --git a/ap/libc/glibc/glibc-2.23/debug/pcprofiledump.c b/ap/libc/glibc/glibc-2.23/debug/pcprofiledump.c
new file mode 100644
index 0000000..2bee597
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/pcprofiledump.c
@@ -0,0 +1,231 @@
+/* Dump information generated by PC profiling.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
+
+   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 is mainly an example.  It shows how programs which want to use
+   the information should read the file.  */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <argp.h>
+#include <byteswap.h>
+#include <errno.h>
+#include <error.h>
+#include <fcntl.h>
+#include <inttypes.h>
+#include <libintl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+
+#include "../version.h"
+
+#define PACKAGE _libc_intl_domainname
+
+#ifndef _
+# define _(Str) gettext (Str)
+#endif
+
+#ifndef N_
+# define N_(Str) Str
+#endif
+
+/* Definitions of arguments for argp functions.  */
+static const struct argp_option options[] =
+{
+  { "unbuffered", 'u', NULL, 0, N_("Don't buffer output") },
+  { NULL, 0, NULL, 0, NULL }
+};
+
+/* Short description of program.  */
+static const char doc[] = N_("Dump information generated by PC profiling.");
+
+/* Strings for arguments in help texts.  */
+static const char args_doc[] = N_("[FILE]");
+
+/* Function to print some extra text in the help message.  */
+static char *more_help (int key, const char *text, void *input);
+
+/* Prototype for option handler.  */
+static error_t parse_opt (int key, char *arg, struct argp_state *state);
+
+/* Name and version of program.  */
+static void print_version (FILE *stream, struct argp_state *state);
+void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
+
+/* Data structure to communicate with argp functions.  */
+static struct argp argp =
+{
+  options, parse_opt, args_doc, doc, NULL, more_help
+};
+
+
+int
+main (int argc, char *argv[])
+{
+  /* Set locale via LC_ALL.  */
+  setlocale (LC_ALL, "");
+
+  /* Set the text message domain.  */
+  textdomain (PACKAGE);
+
+  /* Parse and process arguments.  */
+  int remaining;
+  argp_parse (&argp, argc, argv, 0, &remaining, NULL);
+
+  int fd;
+  if (remaining == argc)
+    fd = STDIN_FILENO;
+  else if (remaining + 1 != argc)
+    {
+      argp_help (&argp, stdout, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR,
+		 program_invocation_short_name);
+      exit (1);
+    }
+  else
+    {
+      /* Open the given file.  */
+      fd = open (argv[remaining], O_RDONLY);
+
+      if (fd == -1)
+	error (EXIT_FAILURE, errno, _("cannot open input file"));
+    }
+
+  /* Read the first 4-byte word.  It contains the information about
+     the word size and the endianess.  */
+  uint32_t word;
+  if (TEMP_FAILURE_RETRY (read (fd, &word, 4)) != 4)
+    error (EXIT_FAILURE, errno, _("cannot read header"));
+
+  /* Check whether we have to swap the byte order.  */
+  int must_swap = (word & 0xfffffff0) == bswap_32 (0xdeb00000);
+  if (must_swap)
+    word = bswap_32 (word);
+
+  /* We have two loops, one for 32 bit pointers, one for 64 bit pointers.  */
+  if (word == 0xdeb00004)
+    {
+      union
+      {
+	uint32_t ptrs[2];
+	char bytes[8];
+      } pair;
+
+      while (1)
+	{
+	  size_t len = sizeof (pair);
+	  size_t n;
+
+	  while (len > 0
+		 && (n = TEMP_FAILURE_RETRY (read (fd, &pair.bytes[8 - len],
+						   len))) != 0)
+	    len -= n;
+
+	  if (len != 0)
+	    /* Nothing to read.  */
+	    break;
+
+	  printf ("this = %#010" PRIx32 ", caller = %#010" PRIx32 "\n",
+		  must_swap ? bswap_32 (pair.ptrs[0]) : pair.ptrs[0],
+		  must_swap ? bswap_32 (pair.ptrs[1]) : pair.ptrs[1]);
+	}
+    }
+  else if (word == 0xdeb00008)
+    {
+      union
+      {
+	uint64_t ptrs[2];
+	char bytes[16];
+      } pair;
+
+      while (1)
+	{
+	  size_t len = sizeof (pair);
+	  size_t n;
+
+	  while (len > 0
+		 && (n = TEMP_FAILURE_RETRY (read (fd, &pair.bytes[8 - len],
+						   len))) != 0)
+	    len -= n;
+
+	  if (len != 0)
+	    /* Nothing to read.  */
+	    break;
+
+	  printf ("this = %#018" PRIx64 ", caller = %#018" PRIx64 "\n",
+		  must_swap ? bswap_64 (pair.ptrs[0]) : pair.ptrs[0],
+		  must_swap ? bswap_64 (pair.ptrs[1]) : pair.ptrs[1]);
+	}
+    }
+  else
+    /* This should not happen.  */
+    error (EXIT_FAILURE, 0, _("invalid pointer size"));
+
+  /* Clean up.  */
+  close (fd);
+
+  return 0;
+}
+
+static error_t
+parse_opt (int key, char *arg, struct argp_state *state)
+{
+  switch (key)
+    {
+    case 'u':
+      setbuf (stdout, NULL);
+      break;
+    default:
+      return ARGP_ERR_UNKNOWN;
+    }
+  return 0;
+}
+
+static char *
+more_help (int key, const char *text, void *input)
+{
+  char *tp = NULL;
+  switch (key)
+    {
+    case ARGP_KEY_HELP_EXTRA:
+      /* We print some extra information.  */
+      if (asprintf (&tp, gettext ("\
+For bug reporting instructions, please see:\n\
+%s.\n"), REPORT_BUGS_TO) < 0)
+	return NULL;
+      return tp;
+    default:
+      break;
+    }
+  return (char *) text;
+}
+
+/* Print the version information.  */
+static void
+print_version (FILE *stream, struct argp_state *state)
+{
+  fprintf (stream, "pcprofiledump %s%s\n", PKGVERSION, VERSION);
+  fprintf (stream, gettext ("\
+Copyright (C) %s Free Software Foundation, Inc.\n\
+This is free software; see the source for copying conditions.  There is NO\n\
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
+"), "2016");
+  fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/poll_chk.c b/ap/libc/glibc/glibc-2.23/debug/poll_chk.c
new file mode 100644
index 0000000..395451b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/poll_chk.c
@@ -0,0 +1,28 @@
+/* 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
+   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 <sys/poll.h>
+
+
+int
+__poll_chk (struct pollfd *fds, nfds_t nfds, int timeout, __SIZE_TYPE__ fdslen)
+{
+  if (fdslen / sizeof (*fds) < nfds)
+    __chk_fail ();
+
+  return __poll (fds, nfds, timeout);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/ppoll_chk.c b/ap/libc/glibc/glibc-2.23/debug/ppoll_chk.c
new file mode 100644
index 0000000..7b6e6b6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/ppoll_chk.c
@@ -0,0 +1,29 @@
+/* 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
+   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 <sys/poll.h>
+
+
+int
+__ppoll_chk (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
+	     const __sigset_t *ss, __SIZE_TYPE__ fdslen)
+{
+  if (fdslen / sizeof (*fds) < nfds)
+    __chk_fail ();
+
+  return ppoll (fds, nfds, timeout, ss);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/pread64_chk.c b/ap/libc/glibc/glibc-2.23/debug/pread64_chk.c
new file mode 100644
index 0000000..972c135
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/pread64_chk.c
@@ -0,0 +1,29 @@
+/* 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
+   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 <sys/param.h>
+
+
+ssize_t
+__pread64_chk (int fd, void *buf, size_t nbytes, off64_t offset, size_t buflen)
+{
+  if (nbytes > buflen)
+    __chk_fail ();
+
+  return __libc_pread64 (fd, buf, nbytes, offset);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/pread_chk.c b/ap/libc/glibc/glibc-2.23/debug/pread_chk.c
new file mode 100644
index 0000000..8afb9db
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/pread_chk.c
@@ -0,0 +1,29 @@
+/* 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
+   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 <sys/param.h>
+
+
+ssize_t
+__pread_chk (int fd, void *buf, size_t nbytes, off_t offset, size_t buflen)
+{
+  if (nbytes > buflen)
+    __chk_fail ();
+
+  return __pread (fd, buf, nbytes, offset);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/printf_chk.c b/ap/libc/glibc/glibc-2.23/debug/printf_chk.c
new file mode 100644
index 0000000..1df2389
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/printf_chk.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to stdout from the format string FORMAT.  */
+int
+___printf_chk (int flag, const char *format, ...)
+{
+  va_list ap;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdout);
+  if (flag > 0)
+    stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  va_start (ap, format);
+  done = vfprintf (stdout, format, ap);
+  va_end (ap);
+
+  if (flag > 0)
+    stdout->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (stdout);
+
+  return done;
+}
+ldbl_strong_alias (___printf_chk, __printf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/read_chk.c b/ap/libc/glibc/glibc-2.23/debug/read_chk.c
new file mode 100644
index 0000000..eee40d8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/read_chk.c
@@ -0,0 +1,37 @@
+/* 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
+   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 <sys/param.h>
+#ifdef HAVE_INLINED_SYSCALLS
+# include <errno.h>
+# include <sysdep.h>
+#endif
+
+
+ssize_t
+__read_chk (int fd, void *buf, size_t nbytes, size_t buflen)
+{
+  if (nbytes > buflen)
+    __chk_fail ();
+
+#ifdef HAVE_INLINED_SYSCALLS
+  return INLINE_SYSCALL (read, 3, fd, buf, nbytes);
+#else
+  return __read (fd, buf, nbytes);
+#endif
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/readlink_chk.c b/ap/libc/glibc/glibc-2.23/debug/readlink_chk.c
new file mode 100644
index 0000000..2573025
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/readlink_chk.c
@@ -0,0 +1,37 @@
+/* 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
+   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 <sys/param.h>
+#ifdef HAVE_INLINED_SYSCALLS
+# include <errno.h>
+# include <sysdep.h>
+#endif
+
+
+ssize_t
+__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
+{
+  if (len > buflen)
+    __chk_fail ();
+
+#ifdef HAVE_INLINED_SYSCALLS
+  return INLINE_SYSCALL (readlink, 3, path, buf, len);
+#else
+  return __readlink (path, buf, len);
+#endif
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/readlinkat_chk.c b/ap/libc/glibc/glibc-2.23/debug/readlinkat_chk.c
new file mode 100644
index 0000000..eb7448d
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/readlinkat_chk.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 2006-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/>.  */
+
+#include <unistd.h>
+#include <sys/param.h>
+
+
+ssize_t
+__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
+		  size_t buflen)
+{
+  if (len > buflen)
+    __chk_fail ();
+
+  return readlinkat (fd, path, buf, len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/readonly-area.c b/ap/libc/glibc/glibc-2.23/debug/readonly-area.c
new file mode 100644
index 0000000..93d3e1e
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/readonly-area.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 2004-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/>.  */
+
+#include <stdlib.h>
+
+/* Return 1 if the whole area PTR .. PTR+SIZE is not writable.
+   Return -1 if it is writable.  */
+
+int
+__readonly_area (const void *ptr, size_t size)
+{
+  /* We cannot determine in general whether memory is writable or not.
+     This must be handled in a system-dependent manner.  to not
+     unconditionally break code we need to return here a positive
+     answer.  This disables this security measure but that is the
+     price people have to pay for using systems without a real
+     implementation of this interface.  */
+  return 1;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/realpath_chk.c b/ap/libc/glibc/glibc-2.23/debug/realpath_chk.c
new file mode 100644
index 0000000..aed49ee
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/realpath_chk.c
@@ -0,0 +1,59 @@
+/* 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
+   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 <limits.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+
+char *
+__realpath_chk (const char *buf, char *resolved, size_t resolvedlen)
+{
+#ifdef PATH_MAX
+  if (resolvedlen < PATH_MAX)
+    __chk_fail ();
+
+  return __realpath (buf, resolved);
+#else
+  long int pathmax =__pathconf (buf, _PC_PATH_MAX);
+  if (pathmax != -1)
+    {
+      /* We do have a fixed limit.  */
+      if (resolvedlen < pathmax)
+	__chk_fail ();
+
+      return __realpath (buf, resolved);
+    }
+
+  /* Since there is no fixed limit we check whether the size is large
+     enough.  */
+  char *res = __realpath (buf, NULL);
+  if (res != NULL)
+    {
+      size_t actlen = strlen (res) + 1;
+      if (actlen > resolvedlen)
+	__chk_fail ();
+
+      memcpy (resolved, res, actlen);
+      free (res);
+      res = resolved;
+    }
+
+  return res;
+#endif
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/recv_chk.c b/ap/libc/glibc/glibc-2.23/debug/recv_chk.c
new file mode 100644
index 0000000..6c05a24
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/recv_chk.c
@@ -0,0 +1,29 @@
+/* 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
+   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 <sys/param.h>
+#include <sys/socket.h>
+
+
+ssize_t
+__recv_chk (int fd, void *buf, size_t n, size_t buflen, int flags)
+{
+  if (n > buflen)
+    __chk_fail ();
+
+  return __recv (fd, buf, n, flags);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/recvfrom_chk.c b/ap/libc/glibc/glibc-2.23/debug/recvfrom_chk.c
new file mode 100644
index 0000000..26d418b
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/recvfrom_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <sys/param.h>
+#include <sys/socket.h>
+
+
+ssize_t
+__recvfrom_chk (int fd, void *buf, size_t n, size_t buflen, int flags,
+		__SOCKADDR_ARG addr, socklen_t *addr_len)
+{
+  if (n > buflen)
+    __chk_fail ();
+
+  return __recvfrom (fd, buf, n, flags, addr, addr_len);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/segfault.c b/ap/libc/glibc/glibc-2.23/debug/segfault.c
new file mode 100644
index 0000000..4f28b33
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/segfault.c
@@ -0,0 +1,210 @@
+/* Catch segmentation faults and print backtrace.
+   Copyright (C) 1998-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
+
+   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 <alloca.h>
+#include <ctype.h>
+#include <errno.h>
+#include <execinfo.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <_itoa.h>
+#include <ldsodefs.h>
+
+/* This file defines macros to access the content of the sigcontext element
+   passed up by the signal handler.  */
+#include <sigcontextinfo.h>
+
+/* Get code to possibly dump the content of all registers.  */
+#include <register-dump.h>
+
+/* We'll use this a lot.  */
+#define WRITE_STRING(s) write (fd, s, strlen (s))
+
+/* Name of the output file.  */
+static const char *fname;
+
+
+/* We better should not use `strerror' since it can call far too many
+   other functions which might fail.  Do it here ourselves.  */
+static void
+write_strsignal (int fd, int signal)
+{
+  if (signal < 0 || signal >= _NSIG || _sys_siglist[signal] == NULL)
+    {
+      char buf[30];
+      char *ptr = _itoa_word (signal, &buf[sizeof (buf)], 10, 0);
+      WRITE_STRING ("signal ");
+      write (fd, buf, &buf[sizeof (buf)] - ptr);
+    }
+  else
+    WRITE_STRING (_sys_siglist[signal]);
+}
+
+
+/* This function is called when a segmentation fault is caught.  The system
+   is in an unstable state now.  This means especially that malloc() might
+   not work anymore.  */
+static void
+catch_segfault (int signal, SIGCONTEXT ctx)
+{
+  int fd, cnt, i;
+  void **arr;
+  struct sigaction sa;
+  uintptr_t pc;
+
+  /* This is the name of the file we are writing to.  If none is given
+     or we cannot write to this file write to stderr.  */
+  fd = 2;
+  if (fname != NULL)
+    {
+      fd = open (fname, O_TRUNC | O_WRONLY | O_CREAT, 0666);
+      if (fd == -1)
+	fd = 2;
+    }
+
+  WRITE_STRING ("*** ");
+  write_strsignal (fd, signal);
+  WRITE_STRING ("\n");
+
+#ifdef REGISTER_DUMP
+  REGISTER_DUMP;
+#endif
+
+  WRITE_STRING ("\nBacktrace:\n");
+
+  /* Get the backtrace.  */
+  arr = alloca (256 * sizeof (void *));
+  cnt = backtrace (arr, 256);
+
+  /* Now try to locate the PC from signal context in the backtrace.
+     Normally it will be found at arr[2], but it might appear later
+     if there were some signal handler wrappers.  Allow a few bytes
+     difference to cope with as many arches as possible.  */
+  pc = (uintptr_t) GET_PC (ctx);
+  for (i = 0; i < cnt; ++i)
+    if ((uintptr_t) arr[i] >= pc - 16 && (uintptr_t) arr[i] <= pc + 16)
+      break;
+
+  /* If we haven't found it, better dump full backtrace even including
+     the signal handler frames instead of not dumping anything.  */
+  if (i == cnt)
+    i = 0;
+
+  /* Now generate nicely formatted output.  */
+  __backtrace_symbols_fd (arr + i, cnt - i, fd);
+
+#ifdef HAVE_PROC_SELF
+  /* Now the link map.  */
+  int mapfd = open ("/proc/self/maps", O_RDONLY);
+  if (mapfd != -1)
+    {
+      write (fd, "\nMemory map:\n\n", 14);
+
+      char buf[256];
+      ssize_t n;
+
+      while ((n = TEMP_FAILURE_RETRY (read (mapfd, buf, sizeof (buf)))) > 0)
+	TEMP_FAILURE_RETRY (write (fd, buf, n));
+
+      close (mapfd);
+    }
+#endif
+
+  /* Pass on the signal (so that a core file is produced).  */
+  sa.sa_handler = SIG_DFL;
+  sigemptyset (&sa.sa_mask);
+  sa.sa_flags = 0;
+  sigaction (signal, &sa, NULL);
+  raise (signal);
+}
+
+
+static void
+__attribute__ ((constructor))
+install_handler (void)
+{
+  struct sigaction sa;
+  const char *sigs = getenv ("SEGFAULT_SIGNALS");
+  const char *name;
+
+  sa.sa_handler = (void *) catch_segfault;
+  sigemptyset (&sa.sa_mask);
+  sa.sa_flags = SA_RESTART;
+
+  /* Maybe we are expected to use an alternative stack.  */
+  if (getenv ("SEGFAULT_USE_ALTSTACK") != 0)
+    {
+      void *stack_mem = malloc (2 * SIGSTKSZ);
+      struct sigaltstack ss;
+
+      if (stack_mem != NULL)
+	{
+	  ss.ss_sp = stack_mem;
+	  ss.ss_flags = 0;
+	  ss.ss_size = 2 * SIGSTKSZ;
+
+	  if (sigaltstack (&ss, NULL) == 0)
+	    sa.sa_flags |= SA_ONSTACK;
+	}
+    }
+
+  if (sigs == NULL)
+    sigaction (SIGSEGV, &sa, NULL);
+  else if (sigs[0] == '\0')
+    /* Do not do anything.  */
+    return;
+  else
+    {
+      const char *where;
+      int all = __strcasecmp (sigs, "all") == 0;
+
+#define INSTALL_FOR_SIG(sig, name) \
+      where = __strcasestr (sigs, name);				      \
+      if (all || (where != NULL						      \
+		  && (where == sigs || !isalnum (where[-1]))		      \
+		  && !isalnum (where[sizeof (name) - 1])))		      \
+	sigaction (sig, &sa, NULL);
+
+      INSTALL_FOR_SIG (SIGSEGV, "segv");
+      INSTALL_FOR_SIG (SIGILL, "ill");
+#ifdef SIGBUS
+      INSTALL_FOR_SIG (SIGBUS, "bus");
+#endif
+#ifdef SIGSTKFLT
+      INSTALL_FOR_SIG (SIGSTKFLT, "stkflt");
+#endif
+      INSTALL_FOR_SIG (SIGABRT, "abrt");
+      INSTALL_FOR_SIG (SIGFPE, "fpe");
+    }
+
+  /* Preserve the output file name if there is any given.  */
+  name = getenv ("SEGFAULT_OUTPUT_NAME");
+  if (name != NULL && name[0] != '\0')
+    {
+      int ret = access (name, R_OK | W_OK);
+
+      if (ret == 0 || (ret == -1 && errno == ENOENT))
+	fname = __strdup (name);
+    }
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/snprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/snprintf_chk.c
new file mode 100644
index 0000000..6948c33
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/snprintf_chk.c
@@ -0,0 +1,39 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+
+/* Write formatted output into S, according to the format
+   string FORMAT, writing no more than MAXLEN characters.  */
+/* VARARGS5 */
+int
+___snprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
+		 const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vsnprintf_chk (s, maxlen, flags, slen, format, arg);
+  va_end (arg);
+
+  return done;
+}
+ldbl_strong_alias (___snprintf_chk, __snprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/sprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/sprintf_chk.c
new file mode 100644
index 0000000..34cb8a3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/sprintf_chk.c
@@ -0,0 +1,36 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <libioP.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+/* Write formatted output into S, according to the format string FORMAT.  */
+/* VARARGS4 */
+int
+___sprintf_chk (char *s, int flags, size_t slen, const char *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vsprintf_chk (s, flags, slen, format, arg);
+  va_end (arg);
+
+  return done;
+}
+ldbl_strong_alias (___sprintf_chk, __sprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail.c b/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail.c
new file mode 100644
index 0000000..4d0796f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail.c
@@ -0,0 +1,29 @@
+/* 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
+   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 <stdio.h>
+#include <stdlib.h>
+
+
+extern char **__libc_argv attribute_hidden;
+
+void
+__attribute__ ((noreturn))
+__stack_chk_fail (void)
+{
+  __fortify_fail ("stack smashing detected");
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail_local.c b/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail_local.c
new file mode 100644
index 0000000..8c469d3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/stack_chk_fail_local.c
@@ -0,0 +1,46 @@
+/* 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
+   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.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   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 <sys/cdefs.h>
+
+extern void __stack_chk_fail (void) __attribute__ ((noreturn));
+
+/* On some architectures, this helps needless PIC pointer setup
+   that would be needed just for the __stack_chk_fail call.  */
+
+void __attribute__ ((noreturn)) attribute_hidden
+__stack_chk_fail_local (void)
+{
+  __stack_chk_fail ();
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/stpcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/stpcpy_chk.c
new file mode 100644
index 0000000..7cc4a21
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/stpcpy_chk.c
@@ -0,0 +1,34 @@
+/* Copyright (C) 1992-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/>.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <string.h>
+
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
+char *
+__stpcpy_chk (char *dest, const char *src, size_t destlen)
+{
+  size_t len = strlen (src);
+  if (len >= destlen)
+    __chk_fail ();
+
+  return memcpy (dest, src, len + 1) + len;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/stpncpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/stpncpy_chk.c
new file mode 100644
index 0000000..bcc14d3
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/stpncpy_chk.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1993-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 is almost copied from strncpy.c, written by Torbjorn Granlund.  */
+
+#include <string.h>
+
+
+/* Copy no more than N characters of SRC to DEST, returning the address of
+   the terminating '\0' in DEST, if any, or else DEST + N.  */
+char *
+__stpncpy_chk (char *dest, const char *src, size_t n, size_t destlen)
+{
+  if (__builtin_expect (destlen < n, 0))
+    __chk_fail ();
+
+  return __stpncpy (dest, src, n);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/strcat_chk.c b/ap/libc/glibc/glibc-2.23/debug/strcat_chk.c
new file mode 100644
index 0000000..518bf09
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/strcat_chk.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <string.h>
+#include <memcopy.h>
+
+
+/* Append SRC on the end of DEST.  */
+char *
+__strcat_chk (char *dest, const char *src, size_t destlen)
+{
+  char *s1 = dest;
+  const char *s2 = src;
+  char c;
+
+  /* Find the end of the string.  */
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *s1++;
+    }
+  while (c != '\0');
+
+  /* Make S1 point before the next character, so we can increment
+     it while memory is read (wins on pipelined cpus).  */
+  ++destlen;
+  s1 -= 2;
+
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *s2++;
+      *++s1 = c;
+    }
+  while (c != '\0');
+
+  return dest;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/strcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/strcpy_chk.c
new file mode 100644
index 0000000..5173de8
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/strcpy_chk.c
@@ -0,0 +1,33 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stddef.h>
+#include <string.h>
+#include <memcopy.h>
+
+#undef strcpy
+
+/* Copy SRC to DEST with checking of destination buffer overflow.  */
+char *
+__strcpy_chk (char *dest, const char *src, size_t destlen)
+{
+  size_t len = strlen (src);
+  if (len >= destlen)
+    __chk_fail ();
+
+  return memcpy (dest, src, len + 1);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/strncat_chk.c b/ap/libc/glibc/glibc-2.23/debug/strncat_chk.c
new file mode 100644
index 0000000..8132b2c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/strncat_chk.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <string.h>
+
+#include <memcopy.h>
+
+
+char *
+__strncat_chk (char *s1, const char *s2, size_t n, size_t s1len)
+{
+  char c;
+  char *s = s1;
+
+  /* Find the end of S1.  */
+  do
+    {
+      if (__glibc_unlikely (s1len-- == 0))
+	__chk_fail ();
+      c = *s1++;
+    }
+  while (c != '\0');
+
+  /* Make S1 point before next character, so we can increment
+     it while memory is read (wins on pipelined cpus).  */
+  ++s1len;
+  s1 -= 2;
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+      do
+	{
+	  if (__glibc_unlikely (s1len-- == 0))
+	    __chk_fail ();
+	  c = *s2++;
+	  *++s1 = c;
+	  if (c == '\0')
+	    return s;
+	  if (__glibc_unlikely (s1len-- == 0))
+	    __chk_fail ();
+	  c = *s2++;
+	  *++s1 = c;
+	  if (c == '\0')
+	    return s;
+	  if (__glibc_unlikely (s1len-- == 0))
+	    __chk_fail ();
+	  c = *s2++;
+	  *++s1 = c;
+	  if (c == '\0')
+	    return s;
+	  if (__glibc_unlikely (s1len-- == 0))
+	    __chk_fail ();
+	  c = *s2++;
+	  *++s1 = c;
+	  if (c == '\0')
+	    return s;
+	} while (--n4 > 0);
+      n &= 3;
+    }
+
+  while (n > 0)
+    {
+      if (__glibc_unlikely (s1len-- == 0))
+	__chk_fail ();
+      c = *s2++;
+      *++s1 = c;
+      if (c == '\0')
+	return s;
+      n--;
+    }
+
+  if (c != '\0')
+    {
+      if (__glibc_unlikely (s1len-- == 0))
+	__chk_fail ();
+      *++s1 = '\0';
+    }
+
+  return s;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/strncpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/strncpy_chk.c
new file mode 100644
index 0000000..9452356
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/strncpy_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <string.h>
+#include <memcopy.h>
+
+
+char *
+__strncpy_chk (char *s1, const char *s2, size_t n, size_t s1len)
+{
+  if (__builtin_expect (s1len < n, 0))
+    __chk_fail ();
+
+  return strncpy (s1, s2, n);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/swprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/swprintf_chk.c
new file mode 100644
index 0000000..563bec4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/swprintf_chk.c
@@ -0,0 +1,35 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <wchar.h>
+
+/* Write formatted output into S, according to the format string FORMAT.  */
+/* VARARGS5 */
+int
+__swprintf_chk (wchar_t *s, size_t n, int flag, size_t s_len,
+		const wchar_t *format, ...)
+{
+  va_list arg;
+  int done;
+
+  va_start (arg, format);
+  done = __vswprintf_chk (s, n, flag, s_len, format, arg);
+  va_end (arg);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/test-stpcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/test-stpcpy_chk.c
new file mode 100644
index 0000000..1f0bdad
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/test-stpcpy_chk.c
@@ -0,0 +1,46 @@
+/* Test and measure stpcpy checking functions.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+
+   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/>.  */
+
+#define STRCPY_RESULT(dst, len) ((dst) + (len))
+#define TEST_MAIN
+#define TEST_NAME "stpcpy_chk"
+#include "../string/test-string.h"
+
+extern void __attribute__ ((noreturn)) __chk_fail (void);
+char *simple_stpcpy_chk (char *, const char *, size_t);
+extern char *normal_stpcpy (char *, const char *, size_t)
+  __asm ("stpcpy");
+extern char *__stpcpy_chk (char *, const char *, size_t);
+
+IMPL (simple_stpcpy_chk, 0)
+IMPL (normal_stpcpy, 1)
+IMPL (__stpcpy_chk, 2)
+
+char *
+simple_stpcpy_chk (char *dst, const char *src, size_t len)
+{
+  if (! len)
+    __chk_fail ();
+  while ((*dst++ = *src++) != '\0')
+    if (--len == 0)
+      __chk_fail ();
+  return dst - 1;
+}
+
+#include "test-strcpy_chk.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/test-strcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/test-strcpy_chk.c
new file mode 100644
index 0000000..4aab09a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/test-strcpy_chk.c
@@ -0,0 +1,355 @@
+/* Test and measure __strcpy_chk functions.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Written by Jakub Jelinek <jakub@redhat.com>, 1999.
+
+   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/>.  */
+
+#ifndef STRCPY_RESULT
+# define STRCPY_RESULT(dst, len) dst
+# define TEST_MAIN
+# define TEST_NAME "strcpy_chk"
+# include "../string/test-string.h"
+
+/* This test case implicitly tests the availability of the __chk_fail
+   symbol, which is part of the public ABI and may be used
+   externally. */
+extern void __attribute__ ((noreturn)) __chk_fail (void);
+char *simple_strcpy_chk (char *, const char *, size_t);
+extern char *normal_strcpy (char *, const char *, size_t)
+  __asm ("strcpy");
+extern char *__strcpy_chk (char *, const char *, size_t);
+
+IMPL (simple_strcpy_chk, 0)
+IMPL (normal_strcpy, 1)
+IMPL (__strcpy_chk, 2)
+
+char *
+simple_strcpy_chk (char *dst, const char *src, size_t len)
+{
+  char *ret = dst;
+  if (! len)
+    __chk_fail ();
+  while ((*dst++ = *src++) != '\0')
+    if (--len == 0)
+      __chk_fail ();
+  return ret;
+}
+#endif
+
+#include <fcntl.h>
+#include <paths.h>
+#include <setjmp.h>
+#include <signal.h>
+
+static int test_main (void);
+#define TEST_FUNCTION test_main ()
+#include "../test-skeleton.c"
+
+volatile int chk_fail_ok;
+jmp_buf chk_fail_buf;
+
+static void
+handler (int sig)
+{
+  if (chk_fail_ok)
+    {
+      chk_fail_ok = 0;
+      longjmp (chk_fail_buf, 1);
+    }
+  else
+    _exit (127);
+}
+
+typedef char *(*proto_t) (char *, const char *, size_t);
+
+static void
+do_one_test (impl_t *impl, char *dst, const char *src,
+	     size_t len, size_t dlen)
+{
+  char *res;
+  if (dlen <= len)
+    {
+      if (impl->test == 1)
+	return;
+
+      chk_fail_ok = 1;
+      if (setjmp (chk_fail_buf) == 0)
+	{
+	  res = CALL (impl, dst, src, dlen);
+	  printf ("*** Function %s (%zd; %zd) did not __chk_fail\n",
+		  impl->name, len, dlen);
+	  chk_fail_ok = 0;
+	  ret = 1;
+	}
+      return;
+    }
+  else
+    res = CALL (impl, dst, src, dlen);
+
+  if (res != STRCPY_RESULT (dst, len))
+    {
+      printf ("Wrong result in function %s %p %p\n", impl->name,
+	      res, STRCPY_RESULT (dst, len));
+      ret = 1;
+      return;
+    }
+
+  if (strcmp (dst, src) != 0)
+    {
+      printf ("Wrong result in function %s dst \"%s\" src \"%s\"\n",
+	      impl->name, dst, src);
+      ret = 1;
+      return;
+    }
+}
+
+static void
+do_test (size_t align1, size_t align2, size_t len, size_t dlen, int max_char)
+{
+  size_t i;
+  char *s1, *s2;
+
+  align1 &= 7;
+  if (align1 + len >= page_size)
+    return;
+
+  align2 &= 7;
+  if (align2 + len >= page_size)
+    return;
+
+  s1 = (char *) buf1 + align1;
+  s2 = (char *) buf2 + align2;
+
+  for (i = 0; i < len; i++)
+    s1[i] = 32 + 23 * i % (max_char - 32);
+  s1[len] = 0;
+
+  FOR_EACH_IMPL (impl, 0)
+    do_one_test (impl, s2, s1, len, dlen);
+}
+
+static void
+do_random_tests (void)
+{
+  size_t i, j, n, align1, align2, len, dlen;
+  unsigned char *p1 = buf1 + page_size - 512;
+  unsigned char *p2 = buf2 + page_size - 512;
+  unsigned char *res;
+
+  for (n = 0; n < ITERATIONS; n++)
+    {
+      align1 = random () & 31;
+      if (random () & 1)
+	align2 = random () & 31;
+      else
+	align2 = align1 + (random () & 24);
+      len = random () & 511;
+      j = align1;
+      if (align2 > j)
+	j = align2;
+      if (len + j >= 511)
+	len = 510 - j - (random () & 7);
+      j = len + align1 + 64;
+      if (j > 512)
+	j = 512;
+      for (i = 0; i < j; i++)
+	{
+	  if (i == len + align1)
+	    p1[i] = 0;
+	  else
+	    {
+	      p1[i] = random () & 255;
+	      if (i >= align1 && i < len + align1 && !p1[i])
+		p1[i] = (random () & 127) + 3;
+	    }
+	}
+
+      switch (random () & 7)
+	{
+	case 0:
+	  dlen = len - (random () & 31);
+	  if (dlen > len)
+	    dlen = len;
+	  break;
+	case 1:
+	  dlen = (size_t) -1;
+	  break;
+	case 2:
+	  dlen = len + 1 + (random () & 65535);
+	  break;
+	case 3:
+	  dlen = len + 1 + (random () & 255);
+	  break;
+	case 4:
+	  dlen = len + 1 + (random () & 31);
+	  break;
+	case 5:
+	  dlen = len + 1 + (random () & 7);
+	  break;
+	case 6:
+	  dlen = len + 1 + (random () & 3);
+	  break;
+	default:
+	  dlen = len + 1;
+	  break;
+	}
+
+      FOR_EACH_IMPL (impl, 1)
+	{
+	  if (dlen <= len)
+	    {
+	      if (impl->test != 1)
+		{
+		  chk_fail_ok = 1;
+		  if (setjmp (chk_fail_buf) == 0)
+		    {
+		      res = (unsigned char *)
+			    CALL (impl, (char *) p2 + align2,
+				  (char *) p1 + align1, dlen);
+		      printf ("Iteration %zd - did not __chk_fail\n", n);
+		      chk_fail_ok = 0;
+		      ret = 1;
+		    }
+		}
+	      continue;
+	    }
+	  memset (p2 - 64, '\1', 512 + 64);
+	  res = (unsigned char *)
+		CALL (impl, (char *) p2 + align2, (char *) p1 + align1, dlen);
+	  if (res != STRCPY_RESULT (p2 + align2, len))
+	    {
+	      printf ("\
+Iteration %zd - wrong result in function %s (%zd, %zd, %zd) %p != %p\n",
+		      n, impl->name, align1, align2, len, res,
+		      STRCPY_RESULT (p2 + align2, len));
+	      ret = 1;
+	    }
+	  for (j = 0; j < align2 + 64; ++j)
+	    {
+	      if (p2[j - 64] != '\1')
+		{
+		  printf ("\
+Iteration %zd - garbage before, %s (%zd, %zd, %zd)\n",
+			  n, impl->name, align1, align2, len);
+		  ret = 1;
+		  break;
+		}
+	    }
+	  for (j = align2 + len + 1; j < 512; ++j)
+	    {
+	      if (p2[j] != '\1')
+		{
+		  printf ("\
+Iteration %zd - garbage after, %s (%zd, %zd, %zd)\n",
+			  n, impl->name, align1, align2, len);
+		  ret = 1;
+		  break;
+		}
+	    }
+	  if (memcmp (p1 + align1, p2 + align2, len + 1))
+	    {
+	      printf ("\
+Iteration %zd - different strings, %s (%zd, %zd, %zd)\n",
+		      n, impl->name, align1, align2, len);
+	      ret = 1;
+	    }
+	}
+    }
+}
+
+static int
+test_main (void)
+{
+  size_t i;
+
+  set_fortify_handler (handler);
+
+  test_init ();
+
+  printf ("%23s", "");
+  FOR_EACH_IMPL (impl, 0)
+    printf ("\t%s", impl->name);
+  putchar ('\n');
+
+  for (i = 0; i < 16; ++i)
+    {
+      do_test (0, 0, i, i + 1, 127);
+      do_test (0, 0, i, i + 1, 255);
+      do_test (0, i, i, i + 1, 127);
+      do_test (i, 0, i, i + 1, 255);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (0, 0, 8 << i, (8 << i) + 1, 127);
+      do_test (8 - i, 2 * i, (8 << i), (8 << i) + 1, 127);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (i, 2 * i, (8 << i), (8 << i) + 1, 127);
+      do_test (2 * i, i, (8 << i), (8 << i) + 1, 255);
+      do_test (i, i, (8 << i), (8 << i) + 1, 127);
+      do_test (i, i, (8 << i), (8 << i) + 1, 255);
+    }
+
+  for (i = 0; i < 16; ++i)
+    {
+      do_test (0, 0, i, i + 256, 127);
+      do_test (0, 0, i, i + 256, 255);
+      do_test (0, i, i, i + 256, 127);
+      do_test (i, 0, i, i + 256, 255);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (0, 0, 8 << i, (8 << i) + 256, 127);
+      do_test (8 - i, 2 * i, (8 << i), (8 << i) + 256, 127);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (i, 2 * i, (8 << i), (8 << i) + 256, 127);
+      do_test (2 * i, i, (8 << i), (8 << i) + 256, 255);
+      do_test (i, i, (8 << i), (8 << i) + 256, 127);
+      do_test (i, i, (8 << i), (8 << i) + 256, 255);
+    }
+
+  for (i = 0; i < 16; ++i)
+    {
+      do_test (0, 0, i, i, 127);
+      do_test (0, 0, i, i + 2, 255);
+      do_test (0, i, i, i + 3, 127);
+      do_test (i, 0, i, i + 4, 255);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (0, 0, 8 << i, (8 << i) - 15, 127);
+      do_test (8 - i, 2 * i, (8 << i), (8 << i) + 5, 127);
+    }
+
+  for (i = 1; i < 8; ++i)
+    {
+      do_test (i, 2 * i, (8 << i), (8 << i) + i, 127);
+      do_test (2 * i, i, (8 << i), (8 << i) + (i - 1), 255);
+      do_test (i, i, (8 << i), (8 << i) + i + 2, 127);
+      do_test (i, i, (8 << i), (8 << i) + i + 3, 255);
+    }
+
+  do_random_tests ();
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace.h b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace.h
new file mode 100644
index 0000000..1a53048
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace.h
@@ -0,0 +1,48 @@
+/* Test backtrace and backtrace_symbols: common code for examining
+   backtraces.
+   Copyright (C) 2013-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/>.  */
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Set to a non-zero value if the test fails.  */
+volatile int ret;
+
+/* Accesses to X are used to prevent optimization.  */
+volatile int x;
+
+/* Called if the test fails.  */
+#define FAIL() \
+  do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
+
+/* Use this attribute to prevent inlining, so that all expected frames
+   are present.  */
+#define NO_INLINE __attribute__ ((noinline))
+
+/* Look for a match in SYM from backtrace_symbols to NAME, a fragment
+   of a function name.  Ignore the filename before '(', but presume
+   that the function names are chosen so they cannot accidentally
+   match the hex offset before the closing ')'. */
+
+static inline bool
+match (const char *sym, const char *name)
+{
+  char *p = strchr (sym, '(');
+  return p != NULL && strstr (p, name) != NULL;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace2.c b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace2.c
new file mode 100644
index 0000000..d139c10
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace2.c
@@ -0,0 +1,105 @@
+/* Test backtrace and backtrace_symbols.
+   Copyright (C) 2009-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/>.  */
+
+#include <execinfo.h>
+#include <search.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "tst-backtrace.h"
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* The backtrace should include at least f1, f2, f3, and do_test.  */
+#define NUM_FUNCTIONS 4
+
+NO_INLINE void
+fn1 (void)
+{
+  void *addresses[NUM_FUNCTIONS];
+  char **symbols;
+  int n;
+  int i;
+
+  /* Get the backtrace addresses.  */
+  n = backtrace (addresses, sizeof (addresses) / sizeof (addresses[0]));
+  printf ("Obtained backtrace with %d functions\n", n);
+  /*  Check that there are at least four functions.  */
+  if (n < NUM_FUNCTIONS)
+    {
+      FAIL ();
+      return;
+    }
+  /* Convert them to symbols.  */
+  symbols = backtrace_symbols (addresses, n);
+  /* Check that symbols were obtained.  */
+  if (symbols == NULL)
+    {
+      FAIL ();
+      return;
+    }
+  for (i = 0; i < n; ++i)
+    printf ("Function %d: %s\n", i, symbols[i]);
+  /* Check that the function names obtained are accurate.  */
+  if (!match (symbols[0], "fn1"))
+    {
+      FAIL ();
+      return;
+    }
+  /* Symbol names are not available for static functions, so we do not
+     check f2.  */
+  if (!match (symbols[2], "fn3"))
+    {
+      FAIL ();
+      return;
+    }
+  /* Symbol names are not available for static functions, so we do not
+     check do_test.  */
+}
+
+NO_INLINE static int
+fn2 (void)
+{
+  fn1 ();
+  /* Prevent tail calls.  */
+  return x;
+}
+
+NO_INLINE int
+fn3 (void)
+{
+  fn2();
+  /* Prevent tail calls.  */
+  return x;
+}
+
+NO_INLINE static int
+do_test (void)
+{
+  /* Test BZ #18084.  */
+  void *buffer[1];
+
+  if (backtrace (buffer, 0) != 0)
+    FAIL ();
+
+  fn3 ();
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace3.c b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace3.c
new file mode 100644
index 0000000..74514d7
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace3.c
@@ -0,0 +1,83 @@
+/* Test backtrace and backtrace_symbols for recursive calls.
+   Copyright (C) 2010-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/>.  */
+
+#include <execinfo.h>
+#include <search.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "tst-backtrace.h"
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* The backtrace should include at least 3 * fn, and do_test.  */
+#define NUM_FUNCTIONS 4
+
+NO_INLINE int
+fn (int c)
+{
+  void *addresses[NUM_FUNCTIONS];
+  char **symbols;
+  int n;
+  int i;
+
+  if (c > 0)
+    {
+      fn (c - 1);
+      return x;
+    }
+  /* Get the backtrace addresses.  */
+  n = backtrace (addresses, sizeof (addresses) / sizeof (addresses[0]));
+  printf ("Obtained backtrace with %d functions\n", n);
+  /*  Check that there are at least four functions.  */
+  if (n < NUM_FUNCTIONS)
+    {
+      FAIL ();
+      return 1;
+    }
+  /* Convert them to symbols.  */
+  symbols = backtrace_symbols (addresses, n);
+  /* Check that symbols were obtained.  */
+  if (symbols == NULL)
+    {
+      FAIL ();
+      return 1;
+    }
+  for (i = 0; i < n; ++i)
+    printf ("Function %d: %s\n", i, symbols[i]);
+  /* Check that the function names obtained are accurate.  */
+  for (i = 0; i < n - 1; ++i)
+    if (!match (symbols[i], "fn"))
+      {
+	FAIL ();
+	return 1;
+      }
+  /* Symbol names are not available for static functions, so we do not
+     check do_test.  */
+  return x;
+}
+
+NO_INLINE static int
+do_test (void)
+{
+  fn (2);
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace4.c b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace4.c
new file mode 100644
index 0000000..965e6bd
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace4.c
@@ -0,0 +1,123 @@
+/* Test backtrace and backtrace_symbols for signal frames.
+   Copyright (C) 2011-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/>.  */
+
+#include <execinfo.h>
+#include <search.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include "tst-backtrace.h"
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* The backtrace should include at least handle_signal, a signal
+   trampoline, 3 * fn, and do_test.  */
+#define NUM_FUNCTIONS 6
+
+volatile int sig_handled = 0;
+
+void
+handle_signal (int signum)
+{
+  void *addresses[NUM_FUNCTIONS];
+  char **symbols;
+  int n;
+  int i;
+
+  sig_handled = 1;
+
+  /* Get the backtrace addresses.  */
+  n = backtrace (addresses, sizeof (addresses) / sizeof (addresses[0]));
+  printf ("Obtained backtrace with %d functions (want at least %d)\n",
+	  n, NUM_FUNCTIONS);
+  /* Check that there are at least NUM_FUNCTIONS functions.  */
+  if (n < NUM_FUNCTIONS)
+    {
+      FAIL ();
+      /* Only return if we got no symbols at all.  The partial output is
+	 still useful for debugging failures.  */
+      if (n <= 0)
+	return;
+    }
+  /* Convert them to symbols.  */
+  symbols = backtrace_symbols (addresses, n);
+  /* Check that symbols were obtained.  */
+  if (symbols == NULL)
+    {
+      FAIL ();
+      return;
+    }
+  for (i = 0; i < n; ++i)
+    printf ("Function %d: %s\n", i, symbols[i]);
+  /* Check that the function names obtained are accurate.  */
+  if (!match (symbols[0], "handle_signal"))
+    FAIL ();
+  /* Do not check name for signal trampoline.  */
+  for (i = 2; i < n - 1; i++)
+    if (!match (symbols[i], "fn"))
+      {
+	FAIL ();
+	return;
+      }
+  /* Symbol names are not available for static functions, so we do not
+     check do_test.  */
+}
+
+NO_INLINE int
+fn (int c)
+{
+  pid_t parent_pid, child_pid;
+
+  if (c > 0)
+    {
+      fn (c - 1);
+      return x;
+    }
+
+  signal (SIGUSR1, handle_signal);
+  parent_pid = getpid ();
+
+  child_pid = fork ();
+  if (child_pid == (pid_t) -1)
+    abort ();
+  else if (child_pid == 0)
+    {
+      sleep (1);
+      kill (parent_pid, SIGUSR1);
+      _exit (0);
+    }
+
+  /* In the parent.  */
+  while (sig_handled == 0)
+    ;
+
+  return 0;
+}
+
+NO_INLINE static int
+do_test (void)
+{
+  fn (2);
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace5.c b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace5.c
new file mode 100644
index 0000000..c049bca
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace5.c
@@ -0,0 +1,141 @@
+/* Test backtrace and backtrace_symbols for signal frames, where a
+   system call was interrupted by a signal.
+   Copyright (C) 2011-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/>.  */
+
+#include <execinfo.h>
+#include <search.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include "tst-backtrace.h"
+
+#ifndef SIGACTION_FLAGS
+# define SIGACTION_FLAGS 0
+#endif
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+/* The backtrace should include at least handle_signal, a signal
+   trampoline, read, 3 * fn, and do_test.  */
+#define NUM_FUNCTIONS 7
+
+void
+handle_signal (int signum)
+{
+  void *addresses[NUM_FUNCTIONS];
+  char **symbols;
+  int n;
+  int i;
+
+  /* Get the backtrace addresses.  */
+  n = backtrace (addresses, sizeof (addresses) / sizeof (addresses[0]));
+  printf ("Obtained backtrace with %d functions\n", n);
+  /*  Check that there are at least seven functions.  */
+  if (n < NUM_FUNCTIONS)
+    {
+      FAIL ();
+      return;
+    }
+  /* Convert them to symbols.  */
+  symbols = backtrace_symbols (addresses, n);
+  /* Check that symbols were obtained.  */
+  if (symbols == NULL)
+    {
+      FAIL ();
+      return;
+    }
+  for (i = 0; i < n; ++i)
+    printf ("Function %d: %s\n", i, symbols[i]);
+  /* Check that the function names obtained are accurate.  */
+  if (!match (symbols[0], "handle_signal"))
+    {
+      FAIL ();
+      return;
+    }
+  /* Do not check name for signal trampoline.  */
+  i = 2;
+  if (!match (symbols[i++], "read"))
+    {
+      /* Perhaps symbols[2] is __kernel_vsyscall?  */
+      if (!match (symbols[i++], "read"))
+	{
+	  FAIL ();
+	  return;
+	}
+    }
+  for (; i < n - 1; i++)
+    if (!match (symbols[i], "fn"))
+      {
+	FAIL ();
+	return;
+      }
+  /* Symbol names are not available for static functions, so we do not
+     check do_test.  */
+}
+
+NO_INLINE int
+fn (int c, int flags)
+{
+  pid_t parent_pid, child_pid;
+  int pipefd[2];
+  char r[1];
+  struct sigaction act;
+
+  if (c > 0)
+    {
+      fn (c - 1, flags);
+      return x;
+    }
+
+  memset (&act, 0, sizeof (act));
+  act.sa_handler = handle_signal;
+  act.sa_flags = flags;
+  sigemptyset (&act.sa_mask);
+  sigaction (SIGUSR1, &act, NULL);
+  parent_pid = getpid ();
+  if (pipe (pipefd) == -1)
+    abort ();
+
+  child_pid = fork ();
+  if (child_pid == (pid_t) -1)
+    abort ();
+  else if (child_pid == 0)
+    {
+      sleep (1);
+      kill (parent_pid, SIGUSR1);
+      _exit (0);
+    }
+
+  /* In the parent.  */
+  read (pipefd[0], r, 1);
+
+  return 0;
+}
+
+NO_INLINE static int
+do_test (void)
+{
+  fn (2, SIGACTION_FLAGS);
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-backtrace6.c b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace6.c
new file mode 100644
index 0000000..12214ce
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-backtrace6.c
@@ -0,0 +1,28 @@
+/* Test backtrace and backtrace_symbols for signal frames, where a
+   system call was interrupted by a signal.
+   Copyright (C) 2013-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/>.  */
+
+#include <signal.h>
+
+#ifdef SA_SIGINFO
+# define SIGACTION_FLAGS SA_SIGINFO
+# include <debug/tst-backtrace5.c>
+#else
+# define TEST_FUNCTION  0
+# include "../test-skeleton.c"
+#endif
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk1.c b/ap/libc/glibc/glibc-2.23/debug/tst-chk1.c
new file mode 100644
index 0000000..4f968ee
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk1.c
@@ -0,0 +1,1623 @@
+/* Copyright (C) 2004-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Jakub Jelinek <jakub@redhat.com>, 2004.
+
+   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 <assert.h>
+#include <fcntl.h>
+#include <locale.h>
+#include <obstack.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <wchar.h>
+#include <sys/poll.h>
+#include <sys/select.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+
+#define obstack_chunk_alloc malloc
+#define obstack_chunk_free free
+
+char *temp_filename;
+static void do_prepare (void);
+static int do_test (void);
+#define PREPARE(argc, argv) do_prepare ()
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+static void
+do_prepare (void)
+{
+  int temp_fd = create_temp_file ("tst-chk1.", &temp_filename);
+  if (temp_fd == -1)
+    {
+      printf ("cannot create temporary file: %m\n");
+      exit (1);
+    }
+
+  const char *strs = "abcdefgh\nABCDEFGHI\nabcdefghij\nABCDEFGHIJ";
+  if ((size_t) write (temp_fd, strs, strlen (strs)) != strlen (strs))
+    {
+      puts ("could not write test strings into file");
+      unlink (temp_filename);
+      exit (1);
+    }
+}
+
+volatile int chk_fail_ok;
+volatile int ret;
+jmp_buf chk_fail_buf;
+
+static void
+handler (int sig)
+{
+  if (chk_fail_ok)
+    {
+      chk_fail_ok = 0;
+      longjmp (chk_fail_buf, 1);
+    }
+  else
+    _exit (127);
+}
+
+char buf[10];
+wchar_t wbuf[10];
+volatile size_t l0;
+volatile char *p;
+volatile wchar_t *wp;
+const char *str1 = "JIHGFEDCBA";
+const char *str2 = "F";
+const char *str3 = "%s%n%s%n";
+const char *str4 = "Hello, ";
+const char *str5 = "World!\n";
+const wchar_t *wstr1 = L"JIHGFEDCBA";
+const wchar_t *wstr2 = L"F";
+const wchar_t *wstr3 = L"%s%n%s%n";
+const wchar_t *wstr4 = L"Hello, ";
+const wchar_t *wstr5 = L"World!\n";
+char buf2[10] = "%s";
+int num1 = 67;
+int num2 = 987654;
+
+#define FAIL() \
+  do { printf ("Failure on line %d\n", __LINE__); ret = 1; } while (0)
+#define CHK_FAIL_START \
+  chk_fail_ok = 1;				\
+  if (! setjmp (chk_fail_buf))			\
+    {
+#define CHK_FAIL_END \
+      chk_fail_ok = 0;				\
+      FAIL ();					\
+    }
+#if __USE_FORTIFY_LEVEL >= 2 && (!defined __cplusplus || defined __va_arg_pack)
+# define CHK_FAIL2_START CHK_FAIL_START
+# define CHK_FAIL2_END CHK_FAIL_END
+#else
+# define CHK_FAIL2_START
+# define CHK_FAIL2_END
+#endif
+
+static int
+do_test (void)
+{
+  set_fortify_handler (handler);
+
+  struct A { char buf1[9]; char buf2[1]; } a;
+  struct wA { wchar_t buf1[9]; wchar_t buf2[1]; } wa;
+
+  printf ("Test checking routines at fortify level %d\n",
+#ifdef __USE_FORTIFY_LEVEL
+	  (int) __USE_FORTIFY_LEVEL
+#else
+	  0
+#endif
+	  );
+
+#if defined __USE_FORTIFY_LEVEL && !defined __fortify_function
+  printf ("Test skipped");
+  if (l0 == 0)
+    return 0;
+#endif
+
+  /* These ops can be done without runtime checking of object size.  */
+  memcpy (buf, "abcdefghij", 10);
+  memmove (buf + 1, buf, 9);
+  if (memcmp (buf, "aabcdefghi", 10))
+    FAIL ();
+
+  if (mempcpy (buf + 5, "abcde", 5) != buf + 10
+      || memcmp (buf, "aabcdabcde", 10))
+    FAIL ();
+
+  memset (buf + 8, 'j', 2);
+  if (memcmp (buf, "aabcdabcjj", 10))
+    FAIL ();
+
+  strcpy (buf + 4, "EDCBA");
+  if (memcmp (buf, "aabcEDCBA", 10))
+    FAIL ();
+
+  if (stpcpy (buf + 8, "F") != buf + 9 || memcmp (buf, "aabcEDCBF", 10))
+    FAIL ();
+
+  strncpy (buf + 6, "X", 4);
+  if (memcmp (buf, "aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (sprintf (buf + 7, "%s", "67") != 2 || memcmp (buf, "aabcEDX67", 10))
+    FAIL ();
+
+  if (snprintf (buf + 7, 3, "%s", "987654") != 6
+      || memcmp (buf, "aabcEDX98", 10))
+    FAIL ();
+
+  /* These ops need runtime checking, but shouldn't __chk_fail.  */
+  memcpy (buf, "abcdefghij", l0 + 10);
+  memmove (buf + 1, buf, l0 + 9);
+  if (memcmp (buf, "aabcdefghi", 10))
+    FAIL ();
+
+  if (mempcpy (buf + 5, "abcde", l0 + 5) != buf + 10
+      || memcmp (buf, "aabcdabcde", 10))
+    FAIL ();
+
+  memset (buf + 8, 'j', l0 + 2);
+  if (memcmp (buf, "aabcdabcjj", 10))
+    FAIL ();
+
+  strcpy (buf + 4, str1 + 5);
+  if (memcmp (buf, "aabcEDCBA", 10))
+    FAIL ();
+
+  if (stpcpy (buf + 8, str2) != buf + 9 || memcmp (buf, "aabcEDCBF", 10))
+    FAIL ();
+
+  strncpy (buf + 6, "X", l0 + 4);
+  if (memcmp (buf, "aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (stpncpy (buf + 5, "cd", l0 + 5) != buf + 7
+      || memcmp (buf, "aabcEcd\0\0", 10))
+    FAIL ();
+
+  if (sprintf (buf + 7, "%d", num1) != 2 || memcmp (buf, "aabcEcd67", 10))
+    FAIL ();
+
+  if (snprintf (buf + 7, 3, "%d", num2) != 6 || memcmp (buf, "aabcEcd98", 10))
+    FAIL ();
+
+  buf[l0 + 8] = '\0';
+  strcat (buf, "A");
+  if (memcmp (buf, "aabcEcd9A", 10))
+    FAIL ();
+
+  buf[l0 + 7] = '\0';
+  strncat (buf, "ZYXWV", l0 + 2);
+  if (memcmp (buf, "aabcEcdZY", 10))
+    FAIL ();
+
+  memcpy (a.buf1, "abcdefghij", l0 + 10);
+  memmove (a.buf1 + 1, a.buf1, l0 + 9);
+  if (memcmp (a.buf1, "aabcdefghi", 10))
+    FAIL ();
+
+  if (mempcpy (a.buf1 + 5, "abcde", l0 + 5) != a.buf1 + 10
+      || memcmp (a.buf1, "aabcdabcde", 10))
+    FAIL ();
+
+  memset (a.buf1 + 8, 'j', l0 + 2);
+  if (memcmp (a.buf1, "aabcdabcjj", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL < 2
+  /* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
+     and sufficient GCC support, as the string operations overflow
+     from a.buf1 into a.buf2.  */
+  strcpy (a.buf1 + 4, str1 + 5);
+  if (memcmp (a.buf1, "aabcEDCBA", 10))
+    FAIL ();
+
+  if (stpcpy (a.buf1 + 8, str2) != a.buf1 + 9
+      || memcmp (a.buf1, "aabcEDCBF", 10))
+    FAIL ();
+
+  strncpy (a.buf1 + 6, "X", l0 + 4);
+  if (memcmp (a.buf1, "aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (sprintf (a.buf1 + 7, "%d", num1) != 2
+      || memcmp (a.buf1, "aabcEDX67", 10))
+    FAIL ();
+
+  if (snprintf (a.buf1 + 7, 3, "%d", num2) != 6
+      || memcmp (a.buf1, "aabcEDX98", 10))
+    FAIL ();
+
+  a.buf1[l0 + 8] = '\0';
+  strcat (a.buf1, "A");
+  if (memcmp (a.buf1, "aabcEDX9A", 10))
+    FAIL ();
+
+  a.buf1[l0 + 7] = '\0';
+  strncat (a.buf1, "ZYXWV", l0 + 2);
+  if (memcmp (a.buf1, "aabcEDXZY", 10))
+    FAIL ();
+
+#endif
+
+#if __USE_FORTIFY_LEVEL >= 1
+  /* Now check if all buffer overflows are caught at runtime.
+     N.B. All tests involving a length parameter need to be done
+     twice: once with the length a compile-time constant, once without.  */
+
+  CHK_FAIL_START
+  memcpy (buf + 1, "abcdefghij", 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memcpy (buf + 1, "abcdefghij", l0 + 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memmove (buf + 2, buf + 1, 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memmove (buf + 2, buf + 1, l0 + 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = (char *) mempcpy (buf + 6, "abcde", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = (char *) mempcpy (buf + 6, "abcde", l0 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memset (buf + 9, 'j', 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memset (buf + 9, 'j', l0 + 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  strcpy (buf + 5, str1 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = stpcpy (buf + 9, str2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  strncpy (buf + 7, "X", 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  strncpy (buf + 7, "X", l0 + 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  stpncpy (buf + 6, "cd", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  stpncpy (buf + 6, "cd", l0 + 5);
+  CHK_FAIL_END
+
+# if !defined __cplusplus || defined __va_arg_pack
+  CHK_FAIL_START
+  sprintf (buf + 8, "%d", num1);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  snprintf (buf + 8, 3, "%d", num2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  snprintf (buf + 8, l0 + 3, "%d", num2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  swprintf (wbuf + 8, 3, L"%d", num1);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  swprintf (wbuf + 8, l0 + 3, L"%d", num1);
+  CHK_FAIL_END
+# endif
+
+  memcpy (buf, str1 + 2, 9);
+  CHK_FAIL_START
+  strcat (buf, "AB");
+  CHK_FAIL_END
+
+  memcpy (buf, str1 + 3, 8);
+  CHK_FAIL_START
+  strncat (buf, "ZYXWV", 3);
+  CHK_FAIL_END
+
+  memcpy (buf, str1 + 3, 8);
+  CHK_FAIL_START
+  strncat (buf, "ZYXWV", l0 + 3);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memcpy (a.buf1 + 1, "abcdefghij", 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memcpy (a.buf1 + 1, "abcdefghij", l0 + 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memmove (a.buf1 + 2, a.buf1 + 1, 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memmove (a.buf1 + 2, a.buf1 + 1, l0 + 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = (char *) mempcpy (a.buf1 + 6, "abcde", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = (char *) mempcpy (a.buf1 + 6, "abcde", l0 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memset (a.buf1 + 9, 'j', 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  memset (a.buf1 + 9, 'j', l0 + 2);
+  CHK_FAIL_END
+
+# if __USE_FORTIFY_LEVEL >= 2
+#  define O 0
+# else
+#  define O 1
+# endif
+
+  CHK_FAIL_START
+  strcpy (a.buf1 + (O + 4), str1 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  p = stpcpy (a.buf1 + (O + 8), str2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  strncpy (a.buf1 + (O + 6), "X", 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  strncpy (a.buf1 + (O + 6), "X", l0 + 4);
+  CHK_FAIL_END
+
+# if !defined __cplusplus || defined __va_arg_pack
+  CHK_FAIL_START
+  sprintf (a.buf1 + (O + 7), "%d", num1);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  snprintf (a.buf1 + (O + 7), 3, "%d", num2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  snprintf (a.buf1 + (O + 7), l0 + 3, "%d", num2);
+  CHK_FAIL_END
+# endif
+
+  memcpy (a.buf1, str1 + (3 - O), 8 + O);
+  CHK_FAIL_START
+  strcat (a.buf1, "AB");
+  CHK_FAIL_END
+
+  memcpy (a.buf1, str1 + (4 - O), 7 + O);
+  CHK_FAIL_START
+  strncat (a.buf1, "ZYXWV", l0 + 3);
+  CHK_FAIL_END
+#endif
+
+
+  /* These ops can be done without runtime checking of object size.  */
+  wmemcpy (wbuf, L"abcdefghij", 10);
+  wmemmove (wbuf + 1, wbuf, 9);
+  if (wmemcmp (wbuf, L"aabcdefghi", 10))
+    FAIL ();
+
+  if (wmempcpy (wbuf + 5, L"abcde", 5) != wbuf + 10
+      || wmemcmp (wbuf, L"aabcdabcde", 10))
+    FAIL ();
+
+  wmemset (wbuf + 8, L'j', 2);
+  if (wmemcmp (wbuf, L"aabcdabcjj", 10))
+    FAIL ();
+
+  wcscpy (wbuf + 4, L"EDCBA");
+  if (wmemcmp (wbuf, L"aabcEDCBA", 10))
+    FAIL ();
+
+  if (wcpcpy (wbuf + 8, L"F") != wbuf + 9 || wmemcmp (wbuf, L"aabcEDCBF", 10))
+    FAIL ();
+
+  wcsncpy (wbuf + 6, L"X", 4);
+  if (wmemcmp (wbuf, L"aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (swprintf (wbuf + 7, 3, L"%ls", L"987654") >= 0
+      || wmemcmp (wbuf, L"aabcEDX98", 10))
+    FAIL ();
+
+  if (swprintf (wbuf + 7, 3, L"64") != 2
+      || wmemcmp (wbuf, L"aabcEDX64", 10))
+    FAIL ();
+
+  /* These ops need runtime checking, but shouldn't __chk_fail.  */
+  wmemcpy (wbuf, L"abcdefghij", l0 + 10);
+  wmemmove (wbuf + 1, wbuf, l0 + 9);
+  if (wmemcmp (wbuf, L"aabcdefghi", 10))
+    FAIL ();
+
+  if (wmempcpy (wbuf + 5, L"abcde", l0 + 5) != wbuf + 10
+      || wmemcmp (wbuf, L"aabcdabcde", 10))
+    FAIL ();
+
+  wmemset (wbuf + 8, L'j', l0 + 2);
+  if (wmemcmp (wbuf, L"aabcdabcjj", 10))
+    FAIL ();
+
+  wcscpy (wbuf + 4, wstr1 + 5);
+  if (wmemcmp (wbuf, L"aabcEDCBA", 10))
+    FAIL ();
+
+  if (wcpcpy (wbuf + 8, wstr2) != wbuf + 9 || wmemcmp (wbuf, L"aabcEDCBF", 10))
+    FAIL ();
+
+  wcsncpy (wbuf + 6, L"X", l0 + 4);
+  if (wmemcmp (wbuf, L"aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (wcpncpy (wbuf + 5, L"cd", l0 + 5) != wbuf + 7
+      || wmemcmp (wbuf, L"aabcEcd\0\0", 10))
+    FAIL ();
+
+  if (swprintf (wbuf + 7, 3, L"%d", num2) >= 0
+      || wmemcmp (wbuf, L"aabcEcd98", 10))
+    FAIL ();
+
+  wbuf[l0 + 8] = L'\0';
+  wcscat (wbuf, L"A");
+  if (wmemcmp (wbuf, L"aabcEcd9A", 10))
+    FAIL ();
+
+  wbuf[l0 + 7] = L'\0';
+  wcsncat (wbuf, L"ZYXWV", l0 + 2);
+  if (wmemcmp (wbuf, L"aabcEcdZY", 10))
+    FAIL ();
+
+  wmemcpy (wa.buf1, L"abcdefghij", l0 + 10);
+  wmemmove (wa.buf1 + 1, wa.buf1, l0 + 9);
+  if (wmemcmp (wa.buf1, L"aabcdefghi", 10))
+    FAIL ();
+
+  if (wmempcpy (wa.buf1 + 5, L"abcde", l0 + 5) != wa.buf1 + 10
+      || wmemcmp (wa.buf1, L"aabcdabcde", 10))
+    FAIL ();
+
+  wmemset (wa.buf1 + 8, L'j', l0 + 2);
+  if (wmemcmp (wa.buf1, L"aabcdabcjj", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL < 2
+  /* The following tests are supposed to crash with -D_FORTIFY_SOURCE=2
+     and sufficient GCC support, as the string operations overflow
+     from a.buf1 into a.buf2.  */
+  wcscpy (wa.buf1 + 4, wstr1 + 5);
+  if (wmemcmp (wa.buf1, L"aabcEDCBA", 10))
+    FAIL ();
+
+  if (wcpcpy (wa.buf1 + 8, wstr2) != wa.buf1 + 9
+      || wmemcmp (wa.buf1, L"aabcEDCBF", 10))
+    FAIL ();
+
+  wcsncpy (wa.buf1 + 6, L"X", l0 + 4);
+  if (wmemcmp (wa.buf1, L"aabcEDX\0\0", 10))
+    FAIL ();
+
+  if (swprintf (wa.buf1 + 7, 3, L"%d", num2) >= 0
+      || wmemcmp (wa.buf1, L"aabcEDX98", 10))
+    FAIL ();
+
+  wa.buf1[l0 + 8] = L'\0';
+  wcscat (wa.buf1, L"A");
+  if (wmemcmp (wa.buf1, L"aabcEDX9A", 10))
+    FAIL ();
+
+  wa.buf1[l0 + 7] = L'\0';
+  wcsncat (wa.buf1, L"ZYXWV", l0 + 2);
+  if (wmemcmp (wa.buf1, L"aabcEDXZY", 10))
+    FAIL ();
+
+#endif
+
+#if __USE_FORTIFY_LEVEL >= 1
+  /* Now check if all buffer overflows are caught at runtime.
+     N.B. All tests involving a length parameter need to be done
+     twice: once with the length a compile-time constant, once without.  */
+
+  CHK_FAIL_START
+  wmemcpy (wbuf + 1, L"abcdefghij", 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemcpy (wbuf + 1, L"abcdefghij", l0 + 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemcpy (wbuf + 9, L"abcdefghij", 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemcpy (wbuf + 9, L"abcdefghij", l0 + 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemmove (wbuf + 2, wbuf + 1, 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemmove (wbuf + 2, wbuf + 1, l0 + 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wmempcpy (wbuf + 6, L"abcde", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wmempcpy (wbuf + 6, L"abcde", l0 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemset (wbuf + 9, L'j', 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemset (wbuf + 9, L'j', l0 + 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcscpy (wbuf + 5, wstr1 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wcpcpy (wbuf + 9, wstr2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcsncpy (wbuf + 7, L"X", 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcsncpy (wbuf + 7, L"X", l0 + 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcsncpy (wbuf + 9, L"XABCDEFGH", 8);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcpncpy (wbuf + 9, L"XABCDEFGH", 8);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcpncpy (wbuf + 6, L"cd", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcpncpy (wbuf + 6, L"cd", l0 + 5);
+  CHK_FAIL_END
+
+  wmemcpy (wbuf, wstr1 + 2, 9);
+  CHK_FAIL_START
+  wcscat (wbuf, L"AB");
+  CHK_FAIL_END
+
+  wmemcpy (wbuf, wstr1 + 3, 8);
+  CHK_FAIL_START
+  wcsncat (wbuf, L"ZYXWV", l0 + 3);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemcpy (wa.buf1 + 1, L"abcdefghij", 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemcpy (wa.buf1 + 1, L"abcdefghij", l0 + 10);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemmove (wa.buf1 + 2, wa.buf1 + 1, 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemmove (wa.buf1 + 2, wa.buf1 + 1, l0 + 9);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wmempcpy (wa.buf1 + 6, L"abcde", 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wmempcpy (wa.buf1 + 6, L"abcde", l0 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemset (wa.buf1 + 9, L'j', 2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wmemset (wa.buf1 + 9, L'j', l0 + 2);
+  CHK_FAIL_END
+
+#if __USE_FORTIFY_LEVEL >= 2
+# define O 0
+#else
+# define O 1
+#endif
+
+  CHK_FAIL_START
+  wcscpy (wa.buf1 + (O + 4), wstr1 + 5);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wp = wcpcpy (wa.buf1 + (O + 8), wstr2);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcsncpy (wa.buf1 + (O + 6), L"X", 4);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  wcsncpy (wa.buf1 + (O + 6), L"X", l0 + 4);
+  CHK_FAIL_END
+
+  wmemcpy (wa.buf1, wstr1 + (3 - O), 8 + O);
+  CHK_FAIL_START
+  wcscat (wa.buf1, L"AB");
+  CHK_FAIL_END
+
+  wmemcpy (wa.buf1, wstr1 + (4 - O), 7 + O);
+  CHK_FAIL_START
+  wcsncat (wa.buf1, L"ZYXWV", l0 + 3);
+  CHK_FAIL_END
+#endif
+
+
+  /* Now checks for %n protection.  */
+
+  /* Constant literals passed directly are always ok
+     (even with warnings about possible bugs from GCC).  */
+  int n1, n2;
+  if (sprintf (buf, "%s%n%s%n", str2, &n1, str2, &n2) != 2
+      || n1 != 1 || n2 != 2)
+    FAIL ();
+
+  /* In this case the format string is not known at compile time,
+     but resides in read-only memory, so is ok.  */
+  if (snprintf (buf, 4, str3, str2, &n1, str2, &n2) != 2
+      || n1 != 1 || n2 != 2)
+    FAIL ();
+
+  strcpy (buf2 + 2, "%n%s%n");
+  /* When the format string is writable and contains %n,
+     with -D_FORTIFY_SOURCE=2 it causes __chk_fail.  */
+  CHK_FAIL2_START
+  if (sprintf (buf, buf2, str2, &n1, str2, &n1) != 2)
+    FAIL ();
+  CHK_FAIL2_END
+
+  CHK_FAIL2_START
+  if (snprintf (buf, 3, buf2, str2, &n1, str2, &n1) != 2)
+    FAIL ();
+  CHK_FAIL2_END
+
+  /* But if there is no %n, even writable format string
+     should work.  */
+  buf2[6] = '\0';
+  if (sprintf (buf, buf2 + 4, str2) != 1)
+    FAIL ();
+
+  /* Constant literals passed directly are always ok
+     (even with warnings about possible bugs from GCC).  */
+  if (printf ("%s%n%s%n", str4, &n1, str5, &n2) != 14
+      || n1 != 7 || n2 != 14)
+    FAIL ();
+
+  /* In this case the format string is not known at compile time,
+     but resides in read-only memory, so is ok.  */
+  if (printf (str3, str4, &n1, str5, &n2) != 14
+      || n1 != 7 || n2 != 14)
+    FAIL ();
+
+  strcpy (buf2 + 2, "%n%s%n");
+  /* When the format string is writable and contains %n,
+     with -D_FORTIFY_SOURCE=2 it causes __chk_fail.  */
+  CHK_FAIL2_START
+  if (printf (buf2, str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  CHK_FAIL2_END
+
+  /* But if there is no %n, even writable format string
+     should work.  */
+  buf2[6] = '\0';
+  if (printf (buf2 + 4, str5) != 7)
+    FAIL ();
+
+  FILE *fp = stdout;
+
+  /* Constant literals passed directly are always ok
+     (even with warnings about possible bugs from GCC).  */
+  if (fprintf (fp, "%s%n%s%n", str4, &n1, str5, &n2) != 14
+      || n1 != 7 || n2 != 14)
+    FAIL ();
+
+  /* In this case the format string is not known at compile time,
+     but resides in read-only memory, so is ok.  */
+  if (fprintf (fp, str3, str4, &n1, str5, &n2) != 14
+      || n1 != 7 || n2 != 14)
+    FAIL ();
+
+  strcpy (buf2 + 2, "%n%s%n");
+  /* When the format string is writable and contains %n,
+     with -D_FORTIFY_SOURCE=2 it causes __chk_fail.  */
+  CHK_FAIL2_START
+  if (fprintf (fp, buf2, str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  CHK_FAIL2_END
+
+  /* But if there is no %n, even writable format string
+     should work.  */
+  buf2[6] = '\0';
+  if (fprintf (fp, buf2 + 4, str5) != 7)
+    FAIL ();
+
+  char *my_ptr = NULL;
+  strcpy (buf2 + 2, "%n%s%n");
+  /* When the format string is writable and contains %n,
+     with -D_FORTIFY_SOURCE=2 it causes __chk_fail.  */
+  CHK_FAIL2_START
+  if (asprintf (&my_ptr, buf2, str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  else
+    free (my_ptr);
+  CHK_FAIL2_END
+
+  struct obstack obs;
+  obstack_init (&obs);
+  CHK_FAIL2_START
+  if (obstack_printf (&obs, buf2, str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  CHK_FAIL2_END
+  obstack_free (&obs, NULL);
+
+  my_ptr = NULL;
+  if (asprintf (&my_ptr, "%s%n%s%n", str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  else
+    free (my_ptr);
+
+  obstack_init (&obs);
+  if (obstack_printf (&obs, "%s%n%s%n", str4, &n1, str5, &n1) != 14)
+    FAIL ();
+  obstack_free (&obs, NULL);
+
+  if (freopen (temp_filename, "r", stdin) == NULL)
+    {
+      puts ("could not open temporary file");
+      exit (1);
+    }
+
+  if (gets (buf) != buf || memcmp (buf, "abcdefgh", 9))
+    FAIL ();
+  if (gets (buf) != buf || memcmp (buf, "ABCDEFGHI", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (gets (buf) != buf)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  rewind (stdin);
+
+  if (fgets (buf, sizeof (buf), stdin) != buf
+      || memcmp (buf, "abcdefgh\n", 10))
+    FAIL ();
+  if (fgets (buf, sizeof (buf), stdin) != buf || memcmp (buf, "ABCDEFGHI", 10))
+    FAIL ();
+
+  rewind (stdin);
+
+  if (fgets (buf, l0 + sizeof (buf), stdin) != buf
+      || memcmp (buf, "abcdefgh\n", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (fgets (buf, sizeof (buf) + 1, stdin) != buf)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (fgets (buf, l0 + sizeof (buf) + 1, stdin) != buf)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  rewind (stdin);
+
+  if (fgets_unlocked (buf, sizeof (buf), stdin) != buf
+      || memcmp (buf, "abcdefgh\n", 10))
+    FAIL ();
+  if (fgets_unlocked (buf, sizeof (buf), stdin) != buf
+      || memcmp (buf, "ABCDEFGHI", 10))
+    FAIL ();
+
+  rewind (stdin);
+
+  if (fgets_unlocked (buf, l0 + sizeof (buf), stdin) != buf
+      || memcmp (buf, "abcdefgh\n", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (fgets_unlocked (buf, sizeof (buf) + 1, stdin) != buf)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (fgets_unlocked (buf, l0 + sizeof (buf) + 1, stdin) != buf)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  rewind (stdin);
+
+  if (fread (buf, 1, sizeof (buf), stdin) != sizeof (buf)
+      || memcmp (buf, "abcdefgh\nA", 10))
+    FAIL ();
+  if (fread (buf, sizeof (buf), 1, stdin) != 1
+      || memcmp (buf, "BCDEFGHI\na", 10))
+    FAIL ();
+
+  rewind (stdin);
+
+  if (fread (buf, l0 + 1, sizeof (buf), stdin) != sizeof (buf)
+      || memcmp (buf, "abcdefgh\nA", 10))
+    FAIL ();
+  if (fread (buf, sizeof (buf), l0 + 1, stdin) != 1
+      || memcmp (buf, "BCDEFGHI\na", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (fread (buf, 1, sizeof (buf) + 1, stdin) != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (fread (buf, sizeof (buf) + 1, l0 + 1, stdin) != 1)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  rewind (stdin);
+
+  if (fread_unlocked (buf, 1, sizeof (buf), stdin) != sizeof (buf)
+      || memcmp (buf, "abcdefgh\nA", 10))
+    FAIL ();
+  if (fread_unlocked (buf, sizeof (buf), 1, stdin) != 1
+      || memcmp (buf, "BCDEFGHI\na", 10))
+    FAIL ();
+
+  rewind (stdin);
+
+  if (fread_unlocked (buf, 1, 4, stdin) != 4
+      || memcmp (buf, "abcdFGHI\na", 10))
+    FAIL ();
+  if (fread_unlocked (buf, 4, 1, stdin) != 1
+      || memcmp (buf, "efghFGHI\na", 10))
+    FAIL ();
+
+  rewind (stdin);
+
+  if (fread_unlocked (buf, l0 + 1, sizeof (buf), stdin) != sizeof (buf)
+      || memcmp (buf, "abcdefgh\nA", 10))
+    FAIL ();
+  if (fread_unlocked (buf, sizeof (buf), l0 + 1, stdin) != 1
+      || memcmp (buf, "BCDEFGHI\na", 10))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (fread_unlocked (buf, 1, sizeof (buf) + 1, stdin) != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (fread_unlocked (buf, sizeof (buf) + 1, l0 + 1, stdin) != 1)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  lseek (fileno (stdin), 0, SEEK_SET);
+
+  if (read (fileno (stdin), buf, sizeof (buf) - 1) != sizeof (buf) - 1
+      || memcmp (buf, "abcdefgh\n", 9))
+    FAIL ();
+  if (read (fileno (stdin), buf, sizeof (buf) - 1) != sizeof (buf) - 1
+      || memcmp (buf, "ABCDEFGHI", 9))
+    FAIL ();
+
+  lseek (fileno (stdin), 0, SEEK_SET);
+
+  if (read (fileno (stdin), buf, l0 + sizeof (buf) - 1) != sizeof (buf) - 1
+      || memcmp (buf, "abcdefgh\n", 9))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (read (fileno (stdin), buf, sizeof (buf) + 1) != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (read (fileno (stdin), buf, l0 + sizeof (buf) + 1) != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  if (pread (fileno (stdin), buf, sizeof (buf) - 1, sizeof (buf) - 2)
+      != sizeof (buf) - 1
+      || memcmp (buf, "\nABCDEFGH", 9))
+    FAIL ();
+  if (pread (fileno (stdin), buf, sizeof (buf) - 1, 0) != sizeof (buf) - 1
+      || memcmp (buf, "abcdefgh\n", 9))
+    FAIL ();
+  if (pread (fileno (stdin), buf, l0 + sizeof (buf) - 1, sizeof (buf) - 3)
+      != sizeof (buf) - 1
+      || memcmp (buf, "h\nABCDEFG", 9))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (pread (fileno (stdin), buf, sizeof (buf) + 1, 2 * sizeof (buf))
+      != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (pread (fileno (stdin), buf, l0 + sizeof (buf) + 1, 2 * sizeof (buf))
+      != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  if (pread64 (fileno (stdin), buf, sizeof (buf) - 1, sizeof (buf) - 2)
+      != sizeof (buf) - 1
+      || memcmp (buf, "\nABCDEFGH", 9))
+    FAIL ();
+  if (pread64 (fileno (stdin), buf, sizeof (buf) - 1, 0) != sizeof (buf) - 1
+      || memcmp (buf, "abcdefgh\n", 9))
+    FAIL ();
+  if (pread64 (fileno (stdin), buf, l0 + sizeof (buf) - 1, sizeof (buf) - 3)
+      != sizeof (buf) - 1
+      || memcmp (buf, "h\nABCDEFG", 9))
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (pread64 (fileno (stdin), buf, sizeof (buf) + 1, 2 * sizeof (buf))
+      != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (pread64 (fileno (stdin), buf, l0 + sizeof (buf) + 1, 2 * sizeof (buf))
+      != sizeof (buf) + 1)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  if (freopen (temp_filename, "r", stdin) == NULL)
+    {
+      puts ("could not open temporary file");
+      exit (1);
+    }
+
+  if (fseek (stdin, 9 + 10 + 11, SEEK_SET))
+    {
+      puts ("could not seek in test file");
+      exit (1);
+    }
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (gets (buf) != buf)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  /* Check whether missing N$ formats are detected.  */
+  CHK_FAIL2_START
+  printf ("%3$d\n", 1, 2, 3, 4);
+  CHK_FAIL2_END
+
+  CHK_FAIL2_START
+  fprintf (stdout, "%3$d\n", 1, 2, 3, 4);
+  CHK_FAIL2_END
+
+  CHK_FAIL2_START
+  sprintf (buf, "%3$d\n", 1, 2, 3, 4);
+  CHK_FAIL2_END
+
+  CHK_FAIL2_START
+  snprintf (buf, sizeof (buf), "%3$d\n", 1, 2, 3, 4);
+  CHK_FAIL2_END
+
+  int sp[2];
+  if (socketpair (PF_UNIX, SOCK_STREAM, 0, sp))
+    FAIL ();
+  else
+    {
+      const char *sendstr = "abcdefgh\nABCDEFGH\n0123456789\n";
+      if ((size_t) send (sp[0], sendstr, strlen (sendstr), 0)
+	  != strlen (sendstr))
+	FAIL ();
+
+      char recvbuf[12];
+      if (recv (sp[1], recvbuf, sizeof recvbuf, MSG_PEEK)
+	  != sizeof recvbuf
+	  || memcmp (recvbuf, sendstr, sizeof recvbuf) != 0)
+	FAIL ();
+
+      if (recv (sp[1], recvbuf + 6, l0 + sizeof recvbuf - 7, MSG_PEEK)
+	  != sizeof recvbuf - 7
+	  || memcmp (recvbuf + 6, sendstr, sizeof recvbuf - 7) != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      if (recv (sp[1], recvbuf + 1, sizeof recvbuf, MSG_PEEK)
+	  != sizeof recvbuf)
+	FAIL ();
+      CHK_FAIL_END
+
+      CHK_FAIL_START
+      if (recv (sp[1], recvbuf + 4, l0 + sizeof recvbuf - 3, MSG_PEEK)
+	  != sizeof recvbuf - 3)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+
+      socklen_t sl;
+      struct sockaddr_un sa_un;
+
+      sl = sizeof (sa_un);
+      if (recvfrom (sp[1], recvbuf, sizeof recvbuf, MSG_PEEK,
+		    (struct sockaddr *) &sa_un, &sl)
+	  != sizeof recvbuf
+	  || memcmp (recvbuf, sendstr, sizeof recvbuf) != 0)
+	FAIL ();
+
+      sl = sizeof (sa_un);
+      if (recvfrom (sp[1], recvbuf + 6, l0 + sizeof recvbuf - 7, MSG_PEEK,
+		    (struct sockaddr *) &sa_un, &sl) != sizeof recvbuf - 7
+	  || memcmp (recvbuf + 6, sendstr, sizeof recvbuf - 7) != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      sl = sizeof (sa_un);
+      if (recvfrom (sp[1], recvbuf + 1, sizeof recvbuf, MSG_PEEK,
+		    (struct sockaddr *) &sa_un, &sl) != sizeof recvbuf)
+	FAIL ();
+      CHK_FAIL_END
+
+      CHK_FAIL_START
+      sl = sizeof (sa_un);
+      if (recvfrom (sp[1], recvbuf + 4, l0 + sizeof recvbuf - 3, MSG_PEEK,
+		    (struct sockaddr *) &sa_un, &sl) != sizeof recvbuf - 3)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+
+      close (sp[0]);
+      close (sp[1]);
+    }
+
+  char fname[] = "/tmp/tst-chk1-dir-XXXXXX\0foo";
+  char *enddir = strchr (fname, '\0');
+  if (mkdtemp (fname) == NULL)
+    {
+      printf ("mkdtemp failed: %m\n");
+      return 1;
+    }
+  *enddir = '/';
+  if (symlink ("bar", fname) != 0)
+    FAIL ();
+
+  char readlinkbuf[4];
+  if (readlink (fname, readlinkbuf, 4) != 3
+      || memcmp (readlinkbuf, "bar", 3) != 0)
+    FAIL ();
+  if (readlink (fname, readlinkbuf + 1, l0 + 3) != 3
+      || memcmp (readlinkbuf, "bbar", 4) != 0)
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (readlink (fname, readlinkbuf + 2, l0 + 3) != 3)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (readlink (fname, readlinkbuf + 3, 4) != 3)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  int tmpfd = open ("/tmp", O_RDONLY | O_DIRECTORY);
+  if (tmpfd < 0)
+    FAIL ();
+
+  if (readlinkat (tmpfd, fname + sizeof ("/tmp/") - 1, readlinkbuf, 4) != 3
+      || memcmp (readlinkbuf, "bar", 3) != 0)
+    FAIL ();
+  if (readlinkat (tmpfd, fname + sizeof ("/tmp/") - 1, readlinkbuf + 1,
+		  l0 + 3) != 3
+      || memcmp (readlinkbuf, "bbar", 4) != 0)
+    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  if (readlinkat (tmpfd, fname + sizeof ("/tmp/") - 1, readlinkbuf + 2,
+		  l0 + 3) != 3)
+    FAIL ();
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  if (readlinkat (tmpfd, fname + sizeof ("/tmp/") - 1, readlinkbuf + 3,
+		  4) != 3)
+    FAIL ();
+  CHK_FAIL_END
+#endif
+
+  close (tmpfd);
+
+  char *cwd1 = getcwd (NULL, 0);
+  if (cwd1 == NULL)
+    FAIL ();
+
+  char *cwd2 = getcwd (NULL, 250);
+  if (cwd2 == NULL)
+    FAIL ();
+
+  if (cwd1 && cwd2)
+    {
+      if (strcmp (cwd1, cwd2) != 0)
+	FAIL ();
+
+      *enddir = '\0';
+      if (chdir (fname))
+	FAIL ();
+
+      char *cwd3 = getcwd (NULL, 0);
+      if (cwd3 == NULL)
+	FAIL ();
+      if (strcmp (fname, cwd3) != 0)
+	printf ("getcwd after chdir is '%s' != '%s',"
+		"get{c,}wd tests skipped\n", cwd3, fname);
+      else
+	{
+	  char getcwdbuf[sizeof fname - 3];
+
+	  char *cwd4 = getcwd (getcwdbuf, sizeof getcwdbuf);
+	  if (cwd4 != getcwdbuf
+	      || strcmp (getcwdbuf, fname) != 0)
+	    FAIL ();
+
+	  cwd4 = getcwd (getcwdbuf + 1, l0 + sizeof getcwdbuf - 1);
+	  if (cwd4 != getcwdbuf + 1
+	      || getcwdbuf[0] != fname[0]
+	      || strcmp (getcwdbuf + 1, fname) != 0)
+	    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+	  CHK_FAIL_START
+	  if (getcwd (getcwdbuf + 2, l0 + sizeof getcwdbuf)
+	      != getcwdbuf + 2)
+	    FAIL ();
+	  CHK_FAIL_END
+
+	  CHK_FAIL_START
+	  if (getcwd (getcwdbuf + 2, sizeof getcwdbuf)
+	      != getcwdbuf + 2)
+	    FAIL ();
+	  CHK_FAIL_END
+#endif
+
+	  if (getwd (getcwdbuf) != getcwdbuf
+	      || strcmp (getcwdbuf, fname) != 0)
+	    FAIL ();
+
+	  if (getwd (getcwdbuf + 1) != getcwdbuf + 1
+	      || strcmp (getcwdbuf + 1, fname) != 0)
+	    FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+	  CHK_FAIL_START
+	  if (getwd (getcwdbuf + 2) != getcwdbuf + 2)
+	    FAIL ();
+	  CHK_FAIL_END
+#endif
+	}
+
+      if (chdir (cwd1) != 0)
+	FAIL ();
+      free (cwd3);
+    }
+
+  free (cwd1);
+  free (cwd2);
+  *enddir = '/';
+  if (unlink (fname) != 0)
+    FAIL ();
+
+  *enddir = '\0';
+  if (rmdir (fname) != 0)
+    FAIL ();
+
+
+#if PATH_MAX > 0
+  char largebuf[PATH_MAX];
+  char *realres = realpath (".", largebuf);
+  if (realres != largebuf)
+    FAIL ();
+
+# if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char realbuf[1];
+  realres = realpath (".", realbuf);
+  if (realres != realbuf)
+    FAIL ();
+  CHK_FAIL_END
+# endif
+#endif
+
+  if (setlocale (LC_ALL, "de_DE.UTF-8") != NULL)
+    {
+      assert (MB_CUR_MAX <= 10);
+
+      /* First a simple test.  */
+      char enough[10];
+      if (wctomb (enough, L'A') != 1)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      /* We know the wchar_t encoding is ISO 10646.  So pick a
+	 character which has a multibyte representation which does not
+	 fit.  */
+      CHK_FAIL_START
+      char smallbuf[2];
+      if (wctomb (smallbuf, L'\x100') != 2)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+
+      mbstate_t s;
+      memset (&s, '\0', sizeof (s));
+      if (wcrtomb (enough, L'D', &s) != 1 || enough[0] != 'D')
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      /* We know the wchar_t encoding is ISO 10646.  So pick a
+	 character which has a multibyte representation which does not
+	 fit.  */
+      CHK_FAIL_START
+      char smallbuf[2];
+      if (wcrtomb (smallbuf, L'\x100', &s) != 2)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+
+      wchar_t wenough[10];
+      memset (&s, '\0', sizeof (s));
+      const char *cp = "A";
+      if (mbsrtowcs (wenough, &cp, 10, &s) != 1
+	  || wcscmp (wenough, L"A") != 0)
+	FAIL ();
+
+      cp = "BC";
+      if (mbsrtowcs (wenough, &cp, l0 + 10, &s) != 2
+	  || wcscmp (wenough, L"BC") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      wchar_t wsmallbuf[2];
+      cp = "ABC";
+      mbsrtowcs (wsmallbuf, &cp, 10, &s);
+      CHK_FAIL_END
+#endif
+
+      cp = "A";
+      if (mbstowcs (wenough, cp, 10) != 1
+	  || wcscmp (wenough, L"A") != 0)
+	FAIL ();
+
+      cp = "DEF";
+      if (mbstowcs (wenough, cp, l0 + 10) != 3
+	  || wcscmp (wenough, L"DEF") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      wchar_t wsmallbuf[2];
+      cp = "ABC";
+      mbstowcs (wsmallbuf, cp, 10);
+      CHK_FAIL_END
+#endif
+
+      memset (&s, '\0', sizeof (s));
+      cp = "ABC";
+      wcscpy (wenough, L"DEF");
+      if (mbsnrtowcs (wenough, &cp, 1, 10, &s) != 1
+	  || wcscmp (wenough, L"AEF") != 0)
+	FAIL ();
+
+      cp = "IJ";
+      if (mbsnrtowcs (wenough, &cp, 1, l0 + 10, &s) != 1
+	  || wcscmp (wenough, L"IEF") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      wchar_t wsmallbuf[2];
+      cp = "ABC";
+      mbsnrtowcs (wsmallbuf, &cp, 3, 10, &s);
+      CHK_FAIL_END
+#endif
+
+      memset (&s, '\0', sizeof (s));
+      const wchar_t *wcp = L"A";
+      if (wcsrtombs (enough, &wcp, 10, &s) != 1
+	  || strcmp (enough, "A") != 0)
+	FAIL ();
+
+      wcp = L"BC";
+      if (wcsrtombs (enough, &wcp, l0 + 10, &s) != 2
+	  || strcmp (enough, "BC") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      char smallbuf[2];
+      wcp = L"ABC";
+      wcsrtombs (smallbuf, &wcp, 10, &s);
+      CHK_FAIL_END
+#endif
+
+      memset (enough, 'Z', sizeof (enough));
+      wcp = L"EF";
+      if (wcstombs (enough, wcp, 10) != 2
+	  || strcmp (enough, "EF") != 0)
+	FAIL ();
+
+      wcp = L"G";
+      if (wcstombs (enough, wcp, l0 + 10) != 1
+	  || strcmp (enough, "G") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      char smallbuf[2];
+      wcp = L"ABC";
+      wcstombs (smallbuf, wcp, 10);
+      CHK_FAIL_END
+#endif
+
+      memset (&s, '\0', sizeof (s));
+      wcp = L"AB";
+      if (wcsnrtombs (enough, &wcp, 1, 10, &s) != 1
+	  || strcmp (enough, "A") != 0)
+	FAIL ();
+
+      wcp = L"BCD";
+      if (wcsnrtombs (enough, &wcp, 1, l0 + 10, &s) != 1
+	  || strcmp (enough, "B") != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      char smallbuf[2];
+      wcp = L"ABC";
+      wcsnrtombs (smallbuf, &wcp, 3, 10, &s);
+      CHK_FAIL_END
+#endif
+    }
+  else
+    {
+      puts ("cannot set locale");
+      ret = 1;
+    }
+
+  int fd = posix_openpt (O_RDWR);
+  if (fd != -1)
+    {
+      char enough[1000];
+      if (ptsname_r (fd, enough, sizeof (enough)) != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      char smallbuf[2];
+      if (ptsname_r (fd, smallbuf, sizeof (smallbuf) + 1) == 0)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+      close (fd);
+    }
+
+#if PATH_MAX > 0
+  confstr (_CS_GNU_LIBC_VERSION, largebuf, sizeof (largebuf));
+# if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char smallbuf[1];
+  confstr (_CS_GNU_LIBC_VERSION, smallbuf, sizeof (largebuf));
+  CHK_FAIL_END
+# endif
+#endif
+
+  gid_t grpslarge[5];
+  int ngr = getgroups (5, grpslarge);
+  asm volatile ("" : : "r" (ngr));
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char smallbuf[1];
+  ngr = getgroups (5, (gid_t *) smallbuf);
+  asm volatile ("" : : "r" (ngr));
+  CHK_FAIL_END
+#endif
+
+  fd = open (_PATH_TTY, O_RDONLY);
+  if (fd != -1)
+    {
+      char enough[1000];
+      if (ttyname_r (fd, enough, sizeof (enough)) != 0)
+	FAIL ();
+
+#if __USE_FORTIFY_LEVEL >= 1
+      CHK_FAIL_START
+      char smallbuf[2];
+      if (ttyname_r (fd, smallbuf, sizeof (smallbuf) + 1) == 0)
+	FAIL ();
+      CHK_FAIL_END
+#endif
+      close (fd);
+    }
+
+  char hostnamelarge[1000];
+  gethostname (hostnamelarge, sizeof (hostnamelarge));
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char smallbuf[1];
+  gethostname (smallbuf, sizeof (hostnamelarge));
+  CHK_FAIL_END
+#endif
+
+  char loginlarge[1000];
+  getlogin_r (loginlarge, sizeof (hostnamelarge));
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char smallbuf[1];
+  getlogin_r (smallbuf, sizeof (loginlarge));
+  CHK_FAIL_END
+#endif
+
+  char domainnamelarge[1000];
+  int res = getdomainname (domainnamelarge, sizeof (domainnamelarge));
+  asm volatile ("" : : "r" (res));
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  char smallbuf[1];
+  res = getdomainname (smallbuf, sizeof (domainnamelarge));
+  asm volatile ("" : : "r" (res));
+  CHK_FAIL_END
+#endif
+
+  fd_set s;
+  FD_ZERO (&s);
+
+  FD_SET (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  FD_SET (FD_SETSIZE, &s);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  FD_SET (l0 + FD_SETSIZE, &s);
+  CHK_FAIL_END
+#endif
+
+  FD_CLR (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  FD_CLR (FD_SETSIZE, &s);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  FD_SET (l0 + FD_SETSIZE, &s);
+  CHK_FAIL_END
+#endif
+
+  FD_ISSET (FD_SETSIZE - 1, &s);
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  FD_ISSET (FD_SETSIZE, &s);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  FD_ISSET (l0 + FD_SETSIZE, &s);
+  CHK_FAIL_END
+#endif
+
+  struct pollfd fds[1];
+  fds[0].fd = STDOUT_FILENO;
+  fds[0].events = POLLOUT;
+  poll (fds, 1, 0);
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  poll (fds, 2, 0);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  poll (fds, l0 + 2, 0);
+  CHK_FAIL_END
+#endif
+  ppoll (fds, 1, NULL, NULL);
+#if __USE_FORTIFY_LEVEL >= 1
+  CHK_FAIL_START
+  ppoll (fds, 2, NULL, NULL);
+  CHK_FAIL_END
+
+  CHK_FAIL_START
+  ppoll (fds, l0 + 2, NULL, NULL);
+  CHK_FAIL_END
+#endif
+
+  return ret;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk2.c b/ap/libc/glibc/glibc-2.23/debug/tst-chk2.c
new file mode 100644
index 0000000..be37ce2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk2.c
@@ -0,0 +1,2 @@
+#define _FORTIFY_SOURCE 1
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk3.c b/ap/libc/glibc/glibc-2.23/debug/tst-chk3.c
new file mode 100644
index 0000000..38b8e4f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk3.c
@@ -0,0 +1,2 @@
+#define _FORTIFY_SOURCE 2
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk4.cc b/ap/libc/glibc/glibc-2.23/debug/tst-chk4.cc
new file mode 100644
index 0000000..c82e6aa
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk4.cc
@@ -0,0 +1 @@
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk5.cc b/ap/libc/glibc/glibc-2.23/debug/tst-chk5.cc
new file mode 100644
index 0000000..be37ce2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk5.cc
@@ -0,0 +1,2 @@
+#define _FORTIFY_SOURCE 1
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-chk6.cc b/ap/libc/glibc/glibc-2.23/debug/tst-chk6.cc
new file mode 100644
index 0000000..38b8e4f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-chk6.cc
@@ -0,0 +1,2 @@
+#define _FORTIFY_SOURCE 2
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk1.c b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk1.c
new file mode 100644
index 0000000..f3e6d47
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk1.c
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk2.c b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk2.c
new file mode 100644
index 0000000..95d4db1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk2.c
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk2.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk3.c b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk3.c
new file mode 100644
index 0000000..50a1ae1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk3.c
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk3.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk4.cc b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk4.cc
new file mode 100644
index 0000000..f3e6d47
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk4.cc
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk1.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk5.cc b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk5.cc
new file mode 100644
index 0000000..95d4db1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk5.cc
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk2.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-lfschk6.cc b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk6.cc
new file mode 100644
index 0000000..50a1ae1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-lfschk6.cc
@@ -0,0 +1,2 @@
+#define _FILE_OFFSET_BITS 64
+#include "tst-chk3.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk.c b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk.c
new file mode 100644
index 0000000..e4e93d2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk.c
@@ -0,0 +1,78 @@
+/* Basic test to make sure doing a longjmp to a jmpbuf with an invalid sp
+   is caught by the fortification code.  */
+#include <errno.h>
+#include <fcntl.h>
+#include <paths.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+static int do_test(void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+
+static jmp_buf b;
+
+
+static void
+__attribute__ ((noinline))
+f (void)
+{
+  char buf[1000];
+  asm volatile ("" : "=m" (buf));
+
+  if (setjmp (b) != 0)
+    {
+      puts ("second longjmp succeeded");
+      exit (1);
+    }
+}
+
+
+static bool expected_to_fail;
+
+
+static void
+handler (int sig)
+{
+  if (expected_to_fail)
+    _exit (0);
+  else
+    {
+      static const char msg[] = "unexpected longjmp failure\n";
+      TEMP_FAILURE_RETRY (write (STDOUT_FILENO, msg, sizeof (msg) - 1));
+      _exit (1);
+    }
+}
+
+
+static int
+do_test (void)
+{
+  set_fortify_handler (handler);
+
+
+  expected_to_fail = false;
+
+  if (setjmp (b) == 0)
+    {
+      longjmp (b, 1);
+      /* NOTREACHED */
+      printf ("first longjmp returned\n");
+      return 1;
+    }
+
+
+  expected_to_fail = true;
+
+  f ();
+  longjmp (b, 1);
+
+  puts ("second longjmp returned");
+  return 1;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk2.c b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk2.c
new file mode 100644
index 0000000..dae9ca0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk2.c
@@ -0,0 +1,119 @@
+/* Verify longjmp fortify checking does not reject signal stacks.
+
+   Test case mostly written by Paolo Bonzini <pbonzini@redhat.com>.  */
+#include <assert.h>
+#include <setjmp.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+
+static jmp_buf mainloop;
+static sigset_t mainsigset;
+static int pass;
+
+
+static void
+stackoverflow_handler (int sig)
+{
+  stack_t altstack;
+  /* Sanity check to keep test from looping forever (in case the longjmp
+     chk code is slightly broken).  */
+  pass++;
+  assert (pass < 5);
+  sigaltstack (NULL, &altstack);
+  /* Using printf is not really kosher in signal handlers but we know
+     it will work.  */
+  printf ("%*sin signal handler\n", pass, "");
+  if (altstack.ss_flags & SS_ONSTACK)
+    printf ("%*son alternate stack\n", pass, "");
+  siglongjmp (mainloop, pass);
+}
+
+
+static volatile int *
+recurse_1 (int n, volatile int *p)
+{
+  if (n >= 0)
+    *recurse_1 (n + 1, p) += n;
+  return p;
+}
+
+
+static int
+recurse (int n)
+{
+  int sum = 0;
+  return *recurse_1 (n, &sum);
+}
+
+
+static int
+do_test (void)
+{
+  char mystack[SIGSTKSZ];
+  stack_t altstack;
+  struct sigaction action;
+  sigset_t emptyset;
+  /* Before starting the endless recursion, try to be friendly to the user's
+     machine.  On some Linux 2.2.x systems, there is no stack limit for user
+     processes at all.  We don't want to kill such systems.  */
+  struct rlimit rl;
+  rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+  setrlimit (RLIMIT_STACK, &rl);
+  /* Install the alternate stack.  */
+  altstack.ss_sp = mystack;
+  altstack.ss_size = sizeof (mystack);
+  altstack.ss_flags = 0; /* no SS_DISABLE */
+  if (sigaltstack (&altstack, NULL) < 0)
+    {
+      puts ("first sigaltstack failed");
+      return 0;
+    }
+  /* Install the SIGSEGV handler.  */
+  sigemptyset (&action.sa_mask);
+  action.sa_handler = &stackoverflow_handler;
+  action.sa_flags = SA_ONSTACK;
+  sigaction (SIGSEGV, &action, (struct sigaction *) NULL);
+  sigaction (SIGBUS, &action, (struct sigaction *) NULL);
+
+  /* Save the current signal mask.  */
+  sigemptyset (&emptyset);
+  sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);
+
+  /* Provoke two stack overflows in a row.  */
+  if (sigsetjmp (mainloop, 1) != 0)
+    {
+      assert (pass != 0);
+      printf ("%*sout of signal handler\n", pass, "");
+    }
+  else
+    assert (pass == 0);
+
+  sigaltstack (NULL, &altstack);
+  if (altstack.ss_flags & SS_ONSTACK)
+    printf ("%*son alternate stack\n", pass, "");
+  else
+    printf ("%*snot on alternate stack\n", pass, "");
+
+  if (pass < 2)
+    {
+      recurse (0);
+      puts ("recurse call returned");
+      return 2;
+    }
+
+  altstack.ss_flags |= SS_DISABLE;
+  if (sigaltstack (&altstack, NULL) == -1)
+    printf ("disabling alternate stack failed\n");
+  else
+    printf ("disabling alternate stack succeeded \n");
+
+  return 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
diff --git a/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk3.c b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk3.c
new file mode 100644
index 0000000..a8bc41c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/tst-longjmp_chk3.c
@@ -0,0 +1,85 @@
+/* Make sure longjmp fortification catches bad signal stacks.
+   Copyright (C) 2013-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/>.  */
+
+#include <setjmp.h>
+#include <signal.h>
+#include <string.h>
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
+static char buf[SIGSTKSZ * 4];
+static jmp_buf jb;
+
+static void
+handler (int sig)
+{
+  if (sig == SIGUSR1)
+    {
+      if (setjmp (jb) != 0)
+	{
+	  puts ("setjmp should not have been called");
+	  kill (getpid (), SIGTERM);
+	}
+    }
+  else if (sig == SIGABRT)
+    {
+      /* Yeah it worked.  */
+      _exit (0);
+    }
+}
+
+static int
+do_test (void)
+{
+  stack_t ss;
+
+  set_fortify_handler (handler);
+
+  /* Create a valid signal stack and enable it.  */
+  ss.ss_sp = buf;
+  ss.ss_size = sizeof (buf);
+  ss.ss_flags = 0;
+  if (sigaltstack (&ss, NULL) < 0)
+    {
+      printf ("first sigaltstack failed: %m\n");
+      return 1;
+    }
+
+  /* Trigger the signal handler which will create a jmpbuf that points to the
+     end of the signal stack.  */
+  signal (SIGUSR1, handler);
+  kill (getpid (), SIGUSR1);
+
+  /* Shrink the signal stack so the jmpbuf is now invalid.
+     We adjust the start & end to handle stacks that grow up & down.  */
+  ss.ss_sp = buf + sizeof (buf) / 2;
+  ss.ss_size = sizeof (buf) / 4;
+  if (sigaltstack (&ss, NULL) < 0)
+    {
+      printf ("second sigaltstack failed: %m\n");
+      return 1;
+    }
+
+  /* This should fail.  */
+  longjmp (jb, 1);
+
+  puts ("longjmp returned and shouldn't");
+  return 1;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/ttyname_r_chk.c b/ap/libc/glibc/glibc-2.23/debug/ttyname_r_chk.c
new file mode 100644
index 0000000..d51d349
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/ttyname_r_chk.c
@@ -0,0 +1,28 @@
+/* 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
+   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>
+
+
+int
+__ttyname_r_chk (int fd, char *buf, size_t buflen, size_t nreal)
+{
+  if (buflen > nreal)
+    __chk_fail ();
+
+  return __ttyname_r (fd, buf, buflen);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/vasprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vasprintf_chk.c
new file mode 100644
index 0000000..cb1f74a
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vasprintf_chk.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 1995-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include <malloc.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
+
+int
+__vasprintf_chk (char **result_ptr, int flags, const char *format,
+		 va_list args)
+{
+  /* Initial size of the buffer to be used.  Will be doubled each time an
+     overflow occurs.  */
+  const _IO_size_t init_string_size = 100;
+  char *string;
+  _IO_strfile sf;
+  int ret;
+  _IO_size_t needed;
+  _IO_size_t allocated;
+  /* No need to clear the memory here (unlike for open_memstream) since
+     we know we will never seek on the stream.  */
+  string = (char *) malloc (init_string_size);
+  if (string == NULL)
+    return -1;
+#ifdef _IO_MTSAFE_IO
+  sf._sbf._f._lock = NULL;
+#endif
+  _IO_no_init (&sf._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+  _IO_JUMPS (&sf._sbf) = &_IO_str_jumps;
+  _IO_str_init_static_internal (&sf, string, init_string_size, string);
+  sf._sbf._f._flags &= ~_IO_USER_BUF;
+  sf._s._allocate_buffer = (_IO_alloc_type) malloc;
+  sf._s._free_buffer = (_IO_free_type) free;
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    sf._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  ret = _IO_vfprintf (&sf._sbf._f, format, args);
+  if (ret < 0)
+    {
+      free (sf._sbf._f._IO_buf_base);
+      return ret;
+    }
+  /* Only use realloc if the size we need is of the same (binary)
+     order of magnitude then the memory we allocated.  */
+  needed = sf._sbf._f._IO_write_ptr - sf._sbf._f._IO_write_base + 1;
+  allocated = sf._sbf._f._IO_write_end - sf._sbf._f._IO_write_base;
+  if ((allocated >> 1) <= needed)
+    *result_ptr = (char *) realloc (sf._sbf._f._IO_buf_base, needed);
+  else
+    {
+      *result_ptr = (char *) malloc (needed);
+      if (*result_ptr != NULL)
+	{
+	  memcpy (*result_ptr, sf._sbf._f._IO_buf_base, needed - 1);
+	  free (sf._sbf._f._IO_buf_base);
+	}
+      else
+	/* We have no choice, use the buffer we already have.  */
+	*result_ptr = (char *) realloc (sf._sbf._f._IO_buf_base, needed);
+    }
+  if (*result_ptr == NULL)
+    *result_ptr = sf._sbf._f._IO_buf_base;
+  (*result_ptr)[needed - 1] = '\0';
+  return ret;
+}
+libc_hidden_def (__vasprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vdprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vdprintf_chk.c
new file mode 100644
index 0000000..05d0bcd
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vdprintf_chk.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 1995-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/>.
+
+   As a special exception, if you link the code in this file with
+   files compiled with a GNU compiler to produce an executable,
+   that does not cause the resulting executable to be covered by
+   the GNU Lesser General Public License.  This exception does not
+   however invalidate any other reasons why the executable file
+   might be covered by the GNU Lesser General Public License.
+   This exception applies to code released by its copyright holders
+   in files containing the exception.  */
+
+#include <libioP.h>
+#include <stdio_ext.h>
+
+int
+__vdprintf_chk (int d, int flags, const char *format, va_list arg)
+{
+  struct _IO_FILE_plus tmpfil;
+  struct _IO_wide_data wd;
+  int done;
+
+#ifdef _IO_MTSAFE_IO
+  tmpfil.file._lock = NULL;
+#endif
+  _IO_no_init (&tmpfil.file, _IO_USER_LOCK, 0, &wd, &_IO_wfile_jumps);
+  _IO_JUMPS (&tmpfil) = &_IO_file_jumps;
+  _IO_file_init (&tmpfil);
+#if  !_IO_UNIFIED_JUMPTABLES
+  tmpfil.vtable = NULL;
+#endif
+  if (_IO_file_attach (&tmpfil.file, d) == NULL)
+    {
+      _IO_un_link (&tmpfil);
+      return EOF;
+    }
+  tmpfil.file._flags |= _IO_DELETE_DONT_CLOSE;
+
+  _IO_mask_flags (&tmpfil.file, _IO_NO_READS,
+		  _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    tmpfil.file._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  done = _IO_vfprintf (&tmpfil.file, format, arg);
+
+  _IO_FINISH (&tmpfil.file);
+
+  return done;
+}
+libc_hidden_def (__vdprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vfprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vfprintf_chk.c
new file mode 100644
index 0000000..4524f51
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vfprintf_chk.c
@@ -0,0 +1,42 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to FP from the format string FORMAT.  */
+int
+___vfprintf_chk (FILE *fp, int flag, const char *format, va_list ap)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (fp);
+  if (flag > 0)
+    fp->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  done = vfprintf (fp, format, ap);
+
+  if (flag > 0)
+    fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (fp);
+
+  return done;
+}
+ldbl_hidden_def (___vfprintf_chk, __vfprintf_chk)
+ldbl_strong_alias (___vfprintf_chk, __vfprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vfwprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vfwprintf_chk.c
new file mode 100644
index 0000000..c3ac230
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vfwprintf_chk.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <wchar.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to FP from the format string FORMAT.  */
+int
+__vfwprintf_chk (FILE *fp, int flag, const wchar_t *format, va_list ap)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (fp);
+  if (flag > 0)
+    fp->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  done = _IO_vfwprintf (fp, format, ap);
+
+  if (flag > 0)
+    fp->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (fp);
+
+  return done;
+}
+libc_hidden_def (__vfwprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vprintf_chk.c
new file mode 100644
index 0000000..b4a959f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vprintf_chk.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to stdout from the format string FORMAT.  */
+int
+___vprintf_chk (int flag, const char *format, va_list ap)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdout);
+  if (flag > 0)
+    stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  done = vfprintf (stdout, format, ap);
+
+  if (flag > 0)
+    stdout->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (stdout);
+
+  return done;
+}
+ldbl_strong_alias (___vprintf_chk, __vprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vsnprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vsnprintf_chk.c
new file mode 100644
index 0000000..cc559d2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vsnprintf_chk.c
@@ -0,0 +1,70 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
+
+extern const struct _IO_jump_t _IO_strn_jumps attribute_hidden;
+
+/* Write formatted output into S, according to the format
+   string FORMAT, writing no more than MAXLEN characters.  */
+/* VARARGS5 */
+int
+___vsnprintf_chk (char *s, size_t maxlen, int flags, size_t slen,
+		  const char *format, va_list args)
+{
+  /* XXX Maybe for less strict version do not fail immediately.
+     Though, maxlen is supposed to be the size of buffer pointed
+     to by s, so a conforming program can't pass such maxlen
+     to *snprintf.  */
+  if (__glibc_unlikely (slen < maxlen))
+    __chk_fail ();
+
+  _IO_strnfile sf;
+  int ret;
+#ifdef _IO_MTSAFE_IO
+  sf.f._sbf._f._lock = NULL;
+#endif
+
+  /* We need to handle the special case where MAXLEN is 0.  Use the
+     overflow buffer right from the start.  */
+  if (maxlen == 0)
+    {
+      s = sf.overflow_buf;
+      maxlen = sizeof (sf.overflow_buf);
+    }
+
+  _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+  _IO_JUMPS (&sf.f._sbf) = &_IO_strn_jumps;
+  s[0] = '\0';
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  _IO_str_init_static_internal (&sf.f, s, maxlen - 1, s);
+  ret = _IO_vfprintf (&sf.f._sbf._f, format, args);
+
+  if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
+    *sf.f._sbf._f._IO_write_ptr = '\0';
+  return ret;
+}
+ldbl_hidden_def (___vsnprintf_chk, __vsnprintf_chk)
+ldbl_strong_alias (___vsnprintf_chk, __vsnprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vsprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vsprintf_chk.c
new file mode 100644
index 0000000..aa1587c
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vsprintf_chk.c
@@ -0,0 +1,89 @@
+/* Copyright (C) 1994-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
+
+
+static int _IO_str_chk_overflow (_IO_FILE *fp, int c) __THROW;
+
+static int
+_IO_str_chk_overflow (_IO_FILE *fp, int c)
+{
+  /* When we come to here this means the user supplied buffer is
+     filled.  */
+  __chk_fail ();
+}
+
+
+static const struct _IO_jump_t _IO_str_chk_jumps =
+{
+  JUMP_INIT_DUMMY,
+  JUMP_INIT(finish, _IO_str_finish),
+  JUMP_INIT(overflow, _IO_str_chk_overflow),
+  JUMP_INIT(underflow, _IO_str_underflow),
+  JUMP_INIT(uflow, _IO_default_uflow),
+  JUMP_INIT(pbackfail, _IO_str_pbackfail),
+  JUMP_INIT(xsputn, _IO_default_xsputn),
+  JUMP_INIT(xsgetn, _IO_default_xsgetn),
+  JUMP_INIT(seekoff, _IO_str_seekoff),
+  JUMP_INIT(seekpos, _IO_default_seekpos),
+  JUMP_INIT(setbuf, _IO_default_setbuf),
+  JUMP_INIT(sync, _IO_default_sync),
+  JUMP_INIT(doallocate, _IO_default_doallocate),
+  JUMP_INIT(read, _IO_default_read),
+  JUMP_INIT(write, _IO_default_write),
+  JUMP_INIT(seek, _IO_default_seek),
+  JUMP_INIT(close, _IO_default_close),
+  JUMP_INIT(stat, _IO_default_stat),
+  JUMP_INIT(showmanyc, _IO_default_showmanyc),
+  JUMP_INIT(imbue, _IO_default_imbue)
+};
+
+
+int
+___vsprintf_chk (char *s, int flags, size_t slen, const char *format,
+		 va_list args)
+{
+  _IO_strfile f;
+  int ret;
+#ifdef _IO_MTSAFE_IO
+  f._sbf._f._lock = NULL;
+#endif
+
+  if (slen == 0)
+    __chk_fail ();
+
+  _IO_no_init (&f._sbf._f, _IO_USER_LOCK, -1, NULL, NULL);
+  _IO_JUMPS (&f._sbf) = &_IO_str_chk_jumps;
+  s[0] = '\0';
+  _IO_str_init_static_internal (&f, s, slen - 1, s);
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  ret = _IO_vfprintf (&f._sbf._f, format, args);
+
+  *f._sbf._f._IO_write_ptr = '\0';
+  return ret;
+}
+ldbl_hidden_def (___vsprintf_chk, __vsprintf_chk)
+ldbl_strong_alias (___vsprintf_chk, __vsprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vswprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vswprintf_chk.c
new file mode 100644
index 0000000..50bdb78
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vswprintf_chk.c
@@ -0,0 +1,74 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <wchar.h>
+#include "../libio/libioP.h"
+#include "../libio/strfile.h"
+
+
+/* Write formatted output into S, according to the format
+   string FORMAT, writing no more than MAXLEN characters.  */
+/* VARARGS5 */
+int
+__vswprintf_chk (wchar_t *s, size_t maxlen, int flags, size_t slen,
+		 const wchar_t *format, va_list args)
+{
+  /* XXX Maybe for less strict version do not fail immediately.
+     Though, maxlen is supposed to be the size of buffer pointed
+     to by s, so a conforming program can't pass such maxlen
+     to *snprintf.  */
+  if (__glibc_unlikely (slen < maxlen))
+    __chk_fail ();
+
+  _IO_wstrnfile sf;
+  struct _IO_wide_data wd;
+  int ret;
+#ifdef _IO_MTSAFE_IO
+  sf.f._sbf._f._lock = NULL;
+#endif
+
+  /* We need to handle the special case where MAXLEN is 0.  Use the
+     overflow buffer right from the start.  */
+  if (__glibc_unlikely (maxlen == 0))
+    /* Since we have to write at least the terminating L'\0' a buffer
+       length of zero always makes the function fail.  */
+    return -1;
+
+  _IO_no_init (&sf.f._sbf._f, _IO_USER_LOCK, 0, &wd, &_IO_wstrn_jumps);
+  _IO_fwide (&sf.f._sbf._f, 1);
+  s[0] = L'\0';
+
+  /* For flags > 0 (i.e. __USE_FORTIFY_LEVEL > 1) request that %n
+     can only come from read-only format strings.  */
+  if (flags > 0)
+    sf.f._sbf._f._flags2 |= _IO_FLAGS2_FORTIFY;
+
+  _IO_wstr_init_static (&sf.f._sbf._f, s, maxlen - 1, s);
+  ret = _IO_vfwprintf ((_IO_FILE *) &sf.f._sbf, format, args);
+
+  if (sf.f._sbf._f._wide_data->_IO_buf_base == sf.overflow_buf)
+    /* ISO C99 requires swprintf/vswprintf to return an error if the
+       output does not fit int he provided buffer.  */
+    return -1;
+
+  /* Terminate the string.  */
+  *sf.f._sbf._f._wide_data->_IO_write_ptr = '\0';
+
+  return ret;
+}
+libc_hidden_def (__vswprintf_chk)
diff --git a/ap/libc/glibc/glibc-2.23/debug/vwprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/vwprintf_chk.c
new file mode 100644
index 0000000..c954e29
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/vwprintf_chk.c
@@ -0,0 +1,41 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to stdout from the format string FORMAT.  */
+int
+__vwprintf_chk (int flag, const wchar_t *format, va_list ap)
+{
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdout);
+  if (flag > 0)
+    stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  done = _IO_vfwprintf (stdout, format, ap);
+
+  if (flag > 0)
+    stdout->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (stdout);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/warning-nop.c b/ap/libc/glibc/glibc-2.23/debug/warning-nop.c
new file mode 100644
index 0000000..f93221f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/warning-nop.c
@@ -0,0 +1,70 @@
+/* Dummy nop functions to elicit link-time warnings.
+   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
+   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.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   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 <sys/cdefs.h>
+
+static void
+__attribute__ ((used))
+nop (void)
+{
+}
+
+/* Don't insert any other #include's before this #undef!  */
+
+#undef __warndecl
+#define __warndecl(name, msg) \
+  extern void name (void) __attribute__ ((alias ("nop"))) attribute_hidden; \
+  link_warning (name, msg)
+
+#undef	__USE_FORTIFY_LEVEL
+#define __USE_FORTIFY_LEVEL 99
+
+/* Following here we need an #include for each public header file
+   that uses __warndecl.  */
+
+/* Define away to avoid warnings with compilers that do not have these
+   builtins.  */
+#define __builtin___memcpy_chk(dest, src, len, bos) NULL
+#define __builtin___memmove_chk(dest, src, len, bos) NULL
+#define __builtin___mempcpy_chk(dest, src, len, bos) NULL
+#define __builtin___memset_chk(dest, ch, len, bos) NULL
+#define __builtin___stpcpy_chk(dest, src, bos) NULL
+#define __builtin___strcat_chk(dest, src, bos) NULL
+#define __builtin___strcpy_chk(dest, src, bos) NULL
+#define __builtin___strncat_chk(dest, src, len, bos) NULL
+#define __builtin___strncpy_chk(dest, src, len, bos) NULL
+#define __builtin_object_size(bos, level) 0
+
+#include <string.h>
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcpcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcpcpy_chk.c
new file mode 100644
index 0000000..36a17f0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcpcpy_chk.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
+
+   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 <wchar.h>
+
+#define __need_ptrdiff_t
+#include <stddef.h>
+
+
+/* Copy SRC to DEST, returning the address of the terminating L'\0' in
+   DEST.  Check for overflows.  */
+wchar_t *
+__wcpcpy_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
+{
+  wchar_t *wcp = (wchar_t *) dest - 1;
+  wint_t c;
+  const ptrdiff_t off = src - dest + 1;
+
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = wcp[off];
+      *++wcp = c;
+    }
+  while (c != L'\0');
+
+  return wcp;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcpncpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcpncpy_chk.c
new file mode 100644
index 0000000..e370535
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcpncpy_chk.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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 <wchar.h>
+
+
+/* Copy no more than N wide-characters of SRC to DEST.	*/
+wchar_t *
+__wcpncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
+{
+  if (__glibc_unlikely (destlen < n))
+    __chk_fail ();
+
+  /* This function is not often enough used to justify not using a
+     tail call.  */
+  return __wcpncpy (dest, src, n);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcrtomb_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcrtomb_chk.c
new file mode 100644
index 0000000..d4c5eb2
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcrtomb_chk.c
@@ -0,0 +1,34 @@
+/* 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
+   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 <langinfo.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <locale/localeinfo.h>
+
+
+size_t
+__wcrtomb_chk (char *s, wchar_t wchar, mbstate_t *ps, size_t buflen)
+{
+  /* We do not have to implement the full wctomb semantics since we
+     know that S cannot be NULL when we come here.  */
+  if (buflen < MB_CUR_MAX)
+    __chk_fail ();
+
+  return __wcrtomb (s, wchar, ps);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcscat_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcscat_chk.c
new file mode 100644
index 0000000..9a5db3f
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcscat_chk.c
@@ -0,0 +1,54 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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 <wchar.h>
+
+
+/* Append SRC on the end of DEST.  Check for overflows.  */
+wchar_t *
+__wcscat_chk (wchar_t *dest, const wchar_t *src, size_t destlen)
+{
+  wchar_t *s1 = dest;
+  const wchar_t *s2 = src;
+  wchar_t c;
+
+  /* Find the end of the string.  */
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *s1++;
+    }
+  while (c != L'\0');
+
+  /* Make S1 point before the next character, so we can increment
+     it while memory is read (wins on pipelined cpus).	*/
+  s1 -= 2;
+  ++destlen;
+
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *s2++;
+      *++s1 = c;
+    }
+  while (c != L'\0');
+
+  return dest;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcscpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcscpy_chk.c
new file mode 100644
index 0000000..9cd9dd0
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcscpy_chk.c
@@ -0,0 +1,60 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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 <stddef.h>
+#include <wchar.h>
+
+
+/* Copy SRC to DEST.  */
+wchar_t *
+__wcscpy_chk (wchar_t *dest, const wchar_t *src, size_t n)
+{
+  wint_t c;
+  wchar_t *wcp;
+
+  if (__alignof__ (wchar_t) >= sizeof (wchar_t))
+    {
+      const ptrdiff_t off = dest - src - 1;
+
+      wcp = (wchar_t *) src;
+
+      do
+	{
+	  if (__glibc_unlikely (n-- == 0))
+	    __chk_fail ();
+	  c = *wcp++;
+	  wcp[off] = c;
+	}
+      while (c != L'\0');
+    }
+  else
+    {
+      wcp = dest;
+
+      do
+	{
+	  if (__glibc_unlikely (n-- == 0))
+	    __chk_fail ();
+	  c = *src++;
+	  *wcp++ = c;
+	}
+      while (c != L'\0');
+    }
+
+  return dest;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcsncat_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcsncat_chk.c
new file mode 100644
index 0000000..b5dd3d9
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcsncat_chk.c
@@ -0,0 +1,95 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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 <wchar.h>
+
+
+/* Append no more than N wide-character of SRC onto DEST.  */
+wchar_t *
+__wcsncat_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
+{
+  wchar_t c;
+  wchar_t * const s = dest;
+
+  /* Find the end of DEST.  */
+  do
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *dest++;
+    }
+  while (c != L'\0');
+
+  /* Make DEST point before next character, so we can increment
+     it while memory is read (wins on pipelined cpus).	*/
+  ++destlen;
+  dest -= 2;
+
+  if (n >= 4)
+    {
+      size_t n4 = n >> 2;
+      do
+	{
+	  if (__glibc_unlikely (destlen-- == 0))
+	    __chk_fail ();
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  if (__glibc_unlikely (destlen-- == 0))
+	    __chk_fail ();
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  if (__glibc_unlikely (destlen-- == 0))
+	    __chk_fail ();
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	  if (__glibc_unlikely (destlen-- == 0))
+	    __chk_fail ();
+	  c = *src++;
+	  *++dest = c;
+	  if (c == L'\0')
+	    return s;
+	} while (--n4 > 0);
+      n &= 3;
+    }
+
+  while (n > 0)
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      c = *src++;
+      *++dest = c;
+      if (c == L'\0')
+	return s;
+      n--;
+    }
+
+  if (c != L'\0')
+    {
+      if (__glibc_unlikely (destlen-- == 0))
+	__chk_fail ();
+      *++dest = L'\0';
+    }
+
+  return s;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcsncpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcsncpy_chk.c
new file mode 100644
index 0000000..79f1e45
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcsncpy_chk.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+   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 <wchar.h>
+
+
+/* Copy no more than N wide-characters of SRC to DEST.	*/
+wchar_t *
+__wcsncpy_chk (wchar_t *dest, const wchar_t *src, size_t n, size_t destlen)
+{
+  if (__glibc_unlikely (destlen < n))
+    __chk_fail ();
+
+  /* This function is not often enough used to justify not using a
+     tail call.  */
+  return __wcsncpy (dest, src, n);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcsnrtombs_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcsnrtombs_chk.c
new file mode 100644
index 0000000..5ba6232
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcsnrtombs_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <locale.h>
+#include <wchar.h>
+
+
+size_t
+__wcsnrtombs_chk (char *dst, const wchar_t **src, size_t nwc, size_t len,
+		  mbstate_t *ps, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return __wcsnrtombs (dst, src, nwc, len, ps);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcsrtombs_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcsrtombs_chk.c
new file mode 100644
index 0000000..d7733c6
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcsrtombs_chk.c
@@ -0,0 +1,30 @@
+/* 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
+   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 <locale.h>
+#include <wchar.h>
+
+
+size_t
+__wcsrtombs_chk (char *dst, const wchar_t **src, size_t len,
+		 mbstate_t *ps, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  return __wcsrtombs (dst, src, len, ps);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wcstombs_chk.c b/ap/libc/glibc/glibc-2.23/debug/wcstombs_chk.c
new file mode 100644
index 0000000..48b0842
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wcstombs_chk.c
@@ -0,0 +1,35 @@
+/* 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
+   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 <locale.h>
+#include <string.h>
+#include <wchar.h>
+
+
+size_t
+__wcstombs_chk (char *dst, const wchar_t *src, size_t len, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < len))
+    __chk_fail ();
+
+  mbstate_t state;
+
+  memset (&state, '\0', sizeof state);
+
+  /* Return how many we wrote (or maybe an error).  */
+  return __wcsrtombs (dst, &src, len, &state);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wctomb_chk.c b/ap/libc/glibc/glibc-2.23/debug/wctomb_chk.c
new file mode 100644
index 0000000..9cfa5ef
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wctomb_chk.c
@@ -0,0 +1,35 @@
+/* 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
+   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 <locale.h>
+#include <stdlib.h>
+#include <wcsmbs/wcsmbsload.h>
+
+
+extern mbstate_t __wctomb_state attribute_hidden; /* Defined in wctomb.c.  */
+
+
+int
+__wctomb_chk (char *s, wchar_t wchar, size_t buflen)
+{
+  /* We do not have to implement the full wctomb semantics since we
+     know that S cannot be NULL when we come here.  */
+  if (buflen < MB_CUR_MAX)
+    __chk_fail ();
+
+  return __wcrtomb (s, wchar, &__wctomb_state);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wmemcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wmemcpy_chk.c
new file mode 100644
index 0000000..ef14a20
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wmemcpy_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
+
+   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 <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmemcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
+{
+  if (__glibc_unlikely (ns1 < n))
+    __chk_fail ();
+  return (wchar_t *) memcpy ((char *) s1, (char *) s2, n * sizeof (wchar_t));
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wmemmove_chk.c b/ap/libc/glibc/glibc-2.23/debug/wmemmove_chk.c
new file mode 100644
index 0000000..329aef5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wmemmove_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
+
+   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 <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmemmove_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
+{
+  if (__glibc_unlikely (ns1 < n))
+    __chk_fail ();
+  return (wchar_t *) memmove ((char *) s1, (char *) s2, n * sizeof (wchar_t));
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wmempcpy_chk.c b/ap/libc/glibc/glibc-2.23/debug/wmempcpy_chk.c
new file mode 100644
index 0000000..b5cc8e5
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wmempcpy_chk.c
@@ -0,0 +1,30 @@
+/* Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
+
+   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 <wchar.h>
+#include <string.h>
+
+
+wchar_t *
+__wmempcpy_chk (wchar_t *s1, const wchar_t *s2, size_t n, size_t ns1)
+{
+  if (__glibc_unlikely (ns1 < n))
+    __chk_fail ();
+  return (wchar_t *) __mempcpy ((char *) s1, (char *) s2,
+				n * sizeof (wchar_t));
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wmemset_chk.c b/ap/libc/glibc/glibc-2.23/debug/wmemset_chk.c
new file mode 100644
index 0000000..88079a1
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wmemset_chk.c
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.org>, 1996.
+
+   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 <wchar.h>
+
+
+wchar_t *
+__wmemset_chk (wchar_t *s, wchar_t c, size_t n, size_t dstlen)
+{
+  if (__glibc_unlikely (dstlen < n))
+    __chk_fail ();
+
+  return wmemset (s, c, n);
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/wprintf_chk.c b/ap/libc/glibc/glibc-2.23/debug/wprintf_chk.c
new file mode 100644
index 0000000..a22b0d4
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/wprintf_chk.c
@@ -0,0 +1,44 @@
+/* Copyright (C) 1991-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/>.  */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <wchar.h>
+#include "../libio/libioP.h"
+
+
+/* Write formatted output to stdout from the format string FORMAT.  */
+int
+__wprintf_chk (int flag, const wchar_t *format, ...)
+{
+  va_list ap;
+  int done;
+
+  _IO_acquire_lock_clear_flags2 (stdout);
+  if (flag > 0)
+    stdout->_flags2 |= _IO_FLAGS2_FORTIFY;
+
+  va_start (ap, format);
+  done = _IO_vfwprintf (stdout, format, ap);
+  va_end (ap);
+
+  if (flag > 0)
+    stdout->_flags2 &= ~_IO_FLAGS2_FORTIFY;
+  _IO_release_lock (stdout);
+
+  return done;
+}
diff --git a/ap/libc/glibc/glibc-2.23/debug/xtrace.sh b/ap/libc/glibc/glibc-2.23/debug/xtrace.sh
new file mode 100755
index 0000000..2f69812
--- /dev/null
+++ b/ap/libc/glibc/glibc-2.23/debug/xtrace.sh
@@ -0,0 +1,195 @@
+#! @BASH@
+# Copyright (C) 1999-2016 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.
+
+# 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/>.
+
+pcprofileso='@SLIBDIR@/libpcprofile.so'
+pcprofiledump='@BINDIR@/pcprofiledump'
+TEXTDOMAIN=libc
+
+# Print usage message.
+do_usage() {
+  printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n"
+  exit 0
+}
+
+# Refer to --help option.
+help_info() {
+  printf >&2 $"Try \`%s --help' or \`%s --usage' for more information.\n" xtrace xtrace
+  exit 1
+}
+
+# Message for missing argument.
+do_missing_arg() {
+  printf >&2 $"%s: option '%s' requires an argument.\n" xtrace "$1"
+  help_info
+}
+
+# Print help message
+do_help() {
+  printf $"Usage: xtrace [OPTION]... PROGRAM [PROGRAMOPTION]...\n"
+  printf $"Trace execution of program by printing currently executed function.
+
+     --data=FILE          Don't run the program, just print the data from FILE.
+
+   -?,--help              Print this help and exit
+      --usage             Give a short usage message
+   -V,--version           Print version information and exit
+
+Mandatory arguments to long options are also mandatory for any corresponding
+short options.
+
+"
+  printf $"For bug reporting instructions, please see:\\n%s.\\n" \
+    "@REPORT_BUGS_TO@"
+  exit 0
+}
+
+do_version() {
+  echo 'xtrace @PKGVERSION@@VERSION@'
+  printf $"Copyright (C) %s Free Software Foundation, Inc.
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+" "2016"
+  printf $"Written by %s.
+" "Ulrich Drepper"
+  exit 0
+}
+
+# Print out function name, file, and line number in a nicely formatted way.
+format_line() {
+  fct=$1
+  file=${2%%:*}
+  line=${2##*:}
+  width=$(expr $COLUMNS - 30)
+  filelen=$(expr length $file)
+  if test "$filelen" -gt "$width"; then
+    rwidth=$(expr $width - 3)
+    file="...$(expr substr $file $(expr 1 + $filelen - $rwidth) $rwidth)"
+  fi
+  printf '%-20s  %-*s  %6s\n' $fct $width $file $line
+}
+
+
+# If the variable COLUMNS is not set do this now.
+COLUMNS=${COLUMNS:-80}
+
+# If `TERMINAL_PROG' is not set, set it to `xterm'.
+TERMINAL_PROG=${TERMINAL_PROG:-xterm}
+
+# The data file to process, if any.
+data=
+
+# Process arguments.  But stop as soon as the program name is found.
+while test $# -gt 0; do
+  case "$1" in
+  --d | --da | --dat | --data)
+    if test $# -eq 1; then
+      do_missing_arg $1
+    fi
+    shift
+    data="$1"
+    ;;
+  --d=* | --da=* | --dat=* | --data=*)
+    data=${1##*=}
+    ;;
+  -\? | --h | --he | --hel | --help)
+    do_help
+    ;;
+  -V | --v | --ve | --ver | --vers | --versi | --versio | --version)
+    do_version
+    ;;
+  --u | --us | --usa | --usag | --usage)
+    do_usage
+    ;;
+  --)
+    # Stop processing arguments.
+    shift
+    break
+    ;;
+  --*)
+    printf >&2 $"xtrace: unrecognized option \`$1'\n"
+    help_info
+    ;;
+  *)
+    # Unknown option.  This means the rest is the program name and parameters.
+    break
+    ;;
+  esac
+  shift
+done
+
+# See whether any arguments are left.
+if test $# -eq 0; then
+  printf >&2 $"No program name given\n"
+  help_info
+fi
+
+# Determine the program name and check whether it exists.
+program=$1
+shift
+if test ! -f "$program"; then
+  printf >&2 $"executable \`$program' not found\n"
+  help_info
+fi
+if test ! -x "$program"; then
+  printf >&2 $"\`$program' is no executable\n"
+  help_info
+fi
+
+# We have two modes.  If a data file is given simply print the included data.
+printf "%-20s  %-*s  %6s\n" Function $(expr $COLUMNS - 30) File Line
+for i in $(seq 1 $COLUMNS); do printf -; done; printf '\n'
+if test -n "$data"; then
+  $pcprofiledump "$data" |
+  sed 's/this = \([^,]*\).*/\1/' |
+  addr2line -fC -e "$program" |
+  while read fct; do
+    read file
+    if test "$fct" != '??' -a "$file" != '??:0'; then
+      format_line "$fct" "$file"
+    fi
+  done
+else
+  fifo=$(mktemp -ut xtrace.XXXXXX) || exit
+  trap 'rm -f "$fifo"; exit 1' HUP INT QUIT TERM PIPE
+  mkfifo -m 0600 $fifo || exit 1
+
+  # Now start the program and let it write to the FIFO.
+  $TERMINAL_PROG -T "xtrace - $program $*" -e /bin/sh -c "LD_PRELOAD=$pcprofileso PCPROFILE_OUTPUT=$fifo $program $*; read < $fifo" &
+  termpid=$!
+  $pcprofiledump -u "$fifo" |
+  while read line; do
+     echo "$line" |
+     sed 's/this = \([^,]*\).*/\1/' |
+     addr2line -fC -e "$program"
+  done |
+  while read fct; do
+    read file
+    if test "$fct" != '??' -a "$file" != '??:0'; then
+      format_line "$fct" "$file"
+    fi
+  done
+  read -p "Press return here to close $TERMINAL_PROG($program)."
+  echo > "$fifo"
+  rm "$fifo"
+fi
+
+exit 0
+# Local Variables:
+#  mode:ksh
+# End:
