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

00db10
commit e782a927c24430100bf2008c96cd421a70285a7e
00db10
Author: Joseph Myers <joseph@codesourcery.com>
00db10
Date:   Fri Feb 1 06:35:29 2013 +0000
00db10
00db10
    Remove BOUNDED_N and BOUNDED_1.
00db10
00db10
Conflicts:
00db10
	sysdeps/sparc/backtrace.c
00db10
00db10
The changes to that file have been applied to
00db10
sysdeps/sparc/sparc64/backtrace.c instead.
00db10
00db10
diff --git a/debug/backtrace.c b/debug/backtrace.c
00db10
index a3fd81c32d176089..d0785329a2514e20 100644
00db10
--- a/debug/backtrace.c
00db10
+++ b/debug/backtrace.c
00db10
@@ -21,7 +21,6 @@
00db10
 #include <signal.h>
00db10
 #include <frame.h>
00db10
 #include <sigcontextinfo.h>
00db10
-#include <bp-checks.h>
00db10
 #include <ldsodefs.h>
00db10
 
00db10
 /* This implementation assumes a stack layout that matches the defaults
00db10
@@ -50,7 +49,7 @@
00db10
 /* By default assume the `next' pointer in struct layout points to the
00db10
    next struct layout.  */
00db10
 #ifndef ADVANCE_STACK_FRAME
00db10
-# define ADVANCE_STACK_FRAME(next) BOUNDED_1 ((struct layout *) (next))
00db10
+# define ADVANCE_STACK_FRAME(next) ((struct layout *) (next))
00db10
 #endif
00db10
 
00db10
 /* By default, the frame pointer is just what we get from gcc.  */
00db10
@@ -72,7 +71,7 @@ __backtrace (array, size)
00db10
   top_stack = CURRENT_STACK_FRAME;
00db10
 
00db10
   /* We skip the call to this function, it makes no sense to record it.  */
00db10
-  current = BOUNDED_1 ((struct layout *) top_frame);
00db10
+  current = ((struct layout *) top_frame);
00db10
   while (cnt < size)
00db10
     {
00db10
       if ((void *) current INNER_THAN top_stack
00db10
diff --git a/sysdeps/generic/bp-checks.h b/sysdeps/generic/bp-checks.h
00db10
index d43e299d4dc06b6b..f2610786aed0cc85 100644
00db10
--- a/sysdeps/generic/bp-checks.h
00db10
+++ b/sysdeps/generic/bp-checks.h
00db10
@@ -66,13 +66,6 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
00db10
 /* Same as CHECK_STRING, but tolerate ARG == NULL.  */
00db10
 # define CHECK_STRING_NULL_OK(ARG) _CHECK_STRING ((ARG), __ptrvalue (ARG))
00db10
 
00db10
-/* Return a bounded pointer with value PTR that satisfies CHECK_N (PTR, N).  */
00db10
-# define BOUNDED_N(PTR, N) 				\
00db10
-  ({ __typeof (PTR) __bounded _p_;			\
00db10
-     __ptrvalue _p_ = __ptrlow _p_ = __ptrvalue (PTR);	\
00db10
-     __ptrhigh _p_ = __ptrvalue _p_ + (N);		\
00db10
-     _p_; })
00db10
-
00db10
 #else /* !__BOUNDED_POINTERS__ */
00db10
 
00db10
 /* Do nothing if not compiling with -fbounded-pointers.  */
00db10
@@ -85,10 +78,7 @@ extern void *__unbounded __ubp_memchr (const void *__unbounded, int, unsigned);
00db10
 # define CHECK_N(ARG, N) (ARG)
00db10
 # define CHECK_N_NULL_OK(ARG, N) (ARG)
00db10
 # define CHECK_STRING(ARG) (ARG)
00db10
-# define BOUNDED_N(PTR, N) (PTR)
00db10
 
00db10
 #endif /* !__BOUNDED_POINTERS__ */
00db10
 
00db10
-#define BOUNDED_1(PTR) BOUNDED_N (PTR, 1)
00db10
-
00db10
 #endif /* _bp_checks_h_ */
00db10
diff --git a/sysdeps/powerpc/powerpc32/backtrace.c b/sysdeps/powerpc/powerpc32/backtrace.c
00db10
index 942951f2bc0ce45d..0e2e5c296876444e 100644
00db10
--- a/sysdeps/powerpc/powerpc32/backtrace.c
00db10
+++ b/sysdeps/powerpc/powerpc32/backtrace.c
00db10
@@ -18,7 +18,6 @@
00db10
 
00db10
 #include <execinfo.h>
00db10
 #include <stddef.h>
00db10
-#include <bp-checks.h>
00db10
 
00db10
 /* This is the stack layout we see with every stack frame.
00db10
    Note that every routine is required by the ABI to lay out the stack
00db10
@@ -47,11 +46,10 @@ __backtrace (void **array, int size)
00db10
 
00db10
   /* Get the address on top-of-stack.  */
00db10
   asm volatile ("lwz %0,0(1)" : "=r"(current));
00db10
-  current = BOUNDED_1 (current);
00db10
 
00db10
   for (				count = 0;
00db10
        current != NULL && 	count < size;
00db10
-       current = BOUNDED_1 (current->next), count++)
00db10
+       current = current->next, count++)
00db10
     array[count] = current->return_address;
00db10
 
00db10
   /* It's possible the second-last stack frame can't return
00db10
diff --git a/sysdeps/powerpc/powerpc64/backtrace.c b/sysdeps/powerpc/powerpc64/backtrace.c
00db10
index 89957a5f4e1efb95..08e535585ef2a104 100644
00db10
--- a/sysdeps/powerpc/powerpc64/backtrace.c
00db10
+++ b/sysdeps/powerpc/powerpc64/backtrace.c
00db10
@@ -18,7 +18,6 @@
00db10
 
00db10
 #include <execinfo.h>
00db10
 #include <stddef.h>
00db10
-#include <bp-checks.h>
00db10
 
00db10
 /* This is the stack layout we see with every stack frame.
00db10
    Note that every routine is required by the ABI to lay out the stack
00db10
@@ -50,11 +49,10 @@ __backtrace (void **array, int size)
00db10
 
00db10
   /* Get the address on top-of-stack.  */
00db10
   asm volatile ("ld %0,0(1)" : "=r"(current));
00db10
-  current = BOUNDED_1 (current);
00db10
 
00db10
   for (				count = 0;
00db10
        current != NULL && 	count < size;
00db10
-       current = BOUNDED_1 (current->next), count++)
00db10
+       current = current->next, count++)
00db10
     array[count] = current->return_address;
00db10
 
00db10
   /* It's possible the second-last stack frame can't return
00db10
diff --git a/sysdeps/sparc/sparc64/backtrace.c b/sysdeps/sparc/sparc64/backtrace.c
00db10
index e9a72a69a0c64d75..d5a1ebec000ce91e 100644
00db10
--- a/sysdeps/sparc/sparc64/backtrace.c
00db10
+++ b/sysdeps/sparc/sparc64/backtrace.c
00db10
@@ -19,7 +19,6 @@
00db10
 
00db10
 #include <execinfo.h>
00db10
 #include <stddef.h>
00db10
-#include <bp-checks.h>
00db10
 #include <sysdep.h>
00db10
 
00db10
 struct layout
00db10
@@ -40,7 +39,6 @@ __backtrace (void **array, int size)
00db10
   asm volatile ("flushw");
00db10
   asm volatile ("mov %%fp, %0" : "=r"(fp));
00db10
   current = (struct layout *__unbounded) (fp + STACK_BIAS);
00db10
-  current = BOUNDED_1 (current);
00db10
 
00db10
   for (count = 0; count < size; count++)
00db10
     {
00db10
@@ -48,7 +46,6 @@ __backtrace (void **array, int size)
00db10
       if (!current->next)
00db10
 	break;
00db10
       current = (struct layout *__unbounded) (current->next + STACK_BIAS);
00db10
-      current = BOUNDED_1 (current);
00db10
     }
00db10
 
00db10
   return count;
00db10
diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c
00db10
index d01bb1bdb779fb0d..21417f4ced70e778 100644
00db10
--- a/sysdeps/unix/sysv/linux/shmat.c
00db10
+++ b/sysdeps/unix/sysv/linux/shmat.c
00db10
@@ -23,7 +23,6 @@
00db10
 #include <sysdep.h>
00db10
 #include <unistd.h>
00db10
 #include <sys/syscall.h>
00db10
-#include <bp-checks.h>
00db10
 
00db10
 /* Attach the shared memory segment associated with SHMID to the data
00db10
    segment of the calling process.  SHMADDR and SHMFLG determine how
00db10
@@ -58,5 +57,5 @@ shmat (shmid, shmaddr, shmflg)
00db10
       return (void *) -1l;
00db10
     }
00db10
 
00db10
-  return BOUNDED_N (raddr, length);
00db10
+  return raddr;
00db10
 }