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

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