olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

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

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