Blame SOURCES/glibc-rh1505492-bounded-4.patch

25845f
commit 3a7ac8a0f596bb73093212cd1109c1413777e1f8
25845f
Author: Joseph Myers <joseph@codesourcery.com>
25845f
Date:   Fri Feb 1 00:06:18 2013 +0000
25845f
25845f
    Remove bp-start.h and INIT_ARGV_and_ENVIRON.
25845f
25845f
Conflicts:
25845f
	sysdeps/generic/bp-start.h
25845f
25845f
Copyright header change; file removed manually.
25845f
25845f
diff --git a/csu/libc-start.c b/csu/libc-start.c
25845f
index ebf9f4ec7335f992..2fab8556a5e2cb26 100644
25845f
--- a/csu/libc-start.c
25845f
+++ b/csu/libc-start.c
25845f
@@ -19,7 +19,6 @@
25845f
 #include <stdio.h>
25845f
 #include <unistd.h>
25845f
 #include <ldsodefs.h>
25845f
-#include <bp-start.h>
25845f
 #include <bp-sym.h>
25845f
 
25845f
 extern void __libc_init_first (int argc, char **argv, char **envp);
25845f
@@ -146,7 +145,7 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
25845f
 #ifndef SHARED
25845f
   char *__unbounded *__unbounded ubp_ev = &ubp_av[argc + 1];
25845f
 
25845f
-  INIT_ARGV_and_ENVIRON;
25845f
+  __environ = ubp_ev;
25845f
 
25845f
   /* Store the lowest stack address.  This is done in ld.so if this is
25845f
      the code for the DSO.  */
25845f
diff --git a/sysdeps/generic/bp-start.h b/sysdeps/generic/bp-start.h
25845f
deleted file mode 100644
25845f
index 0f0339f54cba4aa8..0000000000000000
25845f
--- a/sysdeps/generic/bp-start.h
25845f
+++ /dev/null
25845f
@@ -1,71 +0,0 @@
25845f
-/* Bounded-pointer checking macros for C.
25845f
-   Copyright (C) 2000 Free Software Foundation, Inc.
25845f
-   This file is part of the GNU C Library.
25845f
-   Contributed by Greg McGary <greg@mcgary.org>
25845f
-
25845f
-   The GNU C Library is free software; you can redistribute it and/or
25845f
-   modify it under the terms of the GNU Lesser General Public
25845f
-   License as published by the Free Software Foundation; either
25845f
-   version 2.1 of the License, or (at your option) any later version.
25845f
-
25845f
-   The GNU C Library is distributed in the hope that it will be useful,
25845f
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
25845f
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
25845f
-   Lesser General Public License for more details.
25845f
-
25845f
-   You should have received a copy of the GNU Lesser General Public
25845f
-   License along with the GNU C Library; if not, see
25845f
-   <http://www.gnu.org/licenses/>.  */
25845f
-
25845f
-
25845f
-#if __BOUNDED_POINTERS__
25845f
-
25845f
-  /* The command-line arg vector and environment vector come to us from
25845f
-     the OS as an unbounded pointer to an array of unbounded strings.
25845f
-     The user's main expects argv and __environ to be bounded pointers
25845f
-     to arrays of bounded strings.  */
25845f
-# define INIT_ARGV_and_ENVIRON \
25845f
-  do {									      \
25845f
-    int envc;								      \
25845f
-    for (envc = 0; *ubp_ev; ubp_ev++, envc++)				      \
25845f
-      ;									      \
25845f
-    ubp_ev -= envc;							      \
25845f
-									      \
25845f
-    /* GKM FIXME: we could save some space by allocating only enough for      \
25845f
-       the additional low & high words, and destructively rewriting	      \
25845f
-       argv in place.  */						      \
25845f
-    __ptrvalue (argv) = __ptrlow (argv)					      \
25845f
-      = alloca ((argc + envc + 2) * sizeof (*argv));			      \
25845f
-    __ptrhigh (argv) = __ptrvalue (argv) + argc + 1;			      \
25845f
-    __ptrvalue (__environ) = __ptrlow (__environ) = __ptrhigh (argv);	      \
25845f
-    __ptrhigh (__environ) = __ptrvalue (__environ) + envc + 1;		      \
25845f
-    boundify_vector (__environ, ubp_ev);				      \
25845f
-    boundify_vector (argv, ubp_av);					      \
25845f
-  } while (0)
25845f
-
25845f
-
25845f
-/* Copy an unbounded vector of unbounded strings into a bounded
25845f
-   counterpart.  */
25845f
-
25845f
-static void
25845f
-boundify_vector (char **dest, char *__unbounded *__unbounded src)
25845f
-{
25845f
-  char *__unbounded s;
25845f
-  for (; *src; src++, dest++)
25845f
-    {
25845f
-      __ptrvalue (*dest) = __ptrlow (*dest) = *src;
25845f
-      __ptrhigh (*dest) = src[1];
25845f
-    }
25845f
-  *dest = 0;
25845f
-  /* The OS lays out strings contiguously in vector order,
25845f
-     so  */
25845f
-  for (s = __ptrvalue (dest[-1]); *s; s++)
25845f
-    ;
25845f
-  __ptrhigh (dest[-1]) = ++s;
25845f
-}
25845f
-
25845f
-#else
25845f
-
25845f
-# define INIT_ARGV_and_ENVIRON __environ = ubp_ev
25845f
-
25845f
-#endif
25845f
diff --git a/sysdeps/unix/sysv/linux/powerpc/libc-start.c b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
25845f
index 98a793e0894f6936..89de1aa7e6e1df59 100644
25845f
--- a/sysdeps/unix/sysv/linux/powerpc/libc-start.c
25845f
+++ b/sysdeps/unix/sysv/linux/powerpc/libc-start.c
25845f
@@ -20,7 +20,6 @@
25845f
 #include <unistd.h>
25845f
 #include <ldsodefs.h>
25845f
 #include <sysdep.h>
25845f
-#include <bp-start.h>
25845f
 #include <bp-sym.h>
25845f
 
25845f