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