svn commit: trunk/uClibc: libc/misc/regex libc/string/generic libc etc...

vda at uclibc.org vda at uclibc.org
Fri Dec 12 14:48:11 UTC 2008


Author: vda
Date: 2008-12-12 06:48:10 -0800 (Fri, 12 Dec 2008)
New Revision: 24395

Log:
*: remove vestiges of gcc's "bounded pointers" feature,
 it is dead (not supported by gcc) for years.
 (more of it remains in multiple copies of sigaction.c)



Modified:
   trunk/uClibc/libc/misc/regex/regex_old.c
   trunk/uClibc/libc/string/generic/strcpy.c
   trunk/uClibc/libc/sysdeps/linux/common/sigqueue.c
   trunk/uClibc/libc/sysdeps/linux/x86_64/brk.c
   trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c
   trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c


Changeset:
Modified: trunk/uClibc/libc/misc/regex/regex_old.c
===================================================================
--- trunk/uClibc/libc/misc/regex/regex_old.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libc/misc/regex/regex_old.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -2091,33 +2091,12 @@
 #   define MAX_BUF_SIZE (1L << 16)
 #   define REALLOC(p,s) realloc ((p), (s))
 #  endif
+# endif /* not DEFINED_ONCE */
 
 /* Extend the buffer by twice its current size via realloc and
    reset the pointers that pointed into the old block to point to the
    correct places in the new one.  If extending the buffer results in it
    being larger than MAX_BUF_SIZE, then flag memory exhausted.  */
-#  if __BOUNDED_POINTERS__
-#   define SET_HIGH_BOUND(P) (__ptrhigh (P) = __ptrlow (P) + bufp->allocated)
-#   define MOVE_BUFFER_POINTER(P) \
-  (__ptrlow (P) += incr, SET_HIGH_BOUND (P), __ptrvalue (P) += incr)
-#   define ELSE_EXTEND_BUFFER_HIGH_BOUND	\
-  else						\
-    {						\
-      SET_HIGH_BOUND (b);			\
-      SET_HIGH_BOUND (begalt);			\
-      if (fixup_alt_jump)			\
-	SET_HIGH_BOUND (fixup_alt_jump);	\
-      if (laststart)				\
-	SET_HIGH_BOUND (laststart);		\
-      if (pending_exact)			\
-	SET_HIGH_BOUND (pending_exact);		\
-    }
-#  else
-#   define MOVE_BUFFER_POINTER(P) (P) += incr
-#   define ELSE_EXTEND_BUFFER_HIGH_BOUND
-#  endif
-# endif /* not DEFINED_ONCE */
-
 # ifdef WCHAR
 #  define EXTEND_BUFFER()						\
   do {									\
@@ -2141,16 +2120,15 @@
     if (old_buffer != COMPILED_BUFFER_VAR)				\
       {									\
 	int incr = COMPILED_BUFFER_VAR - old_buffer;			\
-	MOVE_BUFFER_POINTER (b);					\
-	MOVE_BUFFER_POINTER (begalt);					\
+	b += incr;							\
+	begalt += incr;							\
 	if (fixup_alt_jump)						\
-	  MOVE_BUFFER_POINTER (fixup_alt_jump);				\
+	  fixup_alt_jump += incr;					\
 	if (laststart)							\
-	  MOVE_BUFFER_POINTER (laststart);				\
+	  laststart += incr;						\
 	if (pending_exact)						\
-	  MOVE_BUFFER_POINTER (pending_exact);				\
+	  pending_exact += incr;					\
       }									\
-    ELSE_EXTEND_BUFFER_HIGH_BOUND					\
   } while (0)
 # else /* BYTE */
 #  define EXTEND_BUFFER()						\
@@ -2169,16 +2147,15 @@
     if (old_buffer != COMPILED_BUFFER_VAR)				\
       {									\
 	int incr = COMPILED_BUFFER_VAR - old_buffer;			\
-	MOVE_BUFFER_POINTER (b);					\
-	MOVE_BUFFER_POINTER (begalt);					\
+	b += incr;							\
+	begalt += incr;							\
 	if (fixup_alt_jump)						\
-	  MOVE_BUFFER_POINTER (fixup_alt_jump);				\
+	  fixup_alt_jump += incr;					\
 	if (laststart)							\
-	  MOVE_BUFFER_POINTER (laststart);				\
+	  laststart += incr;						\
 	if (pending_exact)						\
-	  MOVE_BUFFER_POINTER (pending_exact);				\
+	  pending_exact += incr;					\
       }									\
-    ELSE_EXTEND_BUFFER_HIGH_BOUND					\
   } while (0)
 # endif /* WCHAR */
 

Modified: trunk/uClibc/libc/string/generic/strcpy.c
===================================================================
--- trunk/uClibc/libc/string/generic/strcpy.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libc/string/generic/strcpy.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -24,24 +24,15 @@
 
 /* Experimentally off - libc_hidden_proto(strcpy) */
 /* Copy SRC to DEST.  */
-char *strcpy (char *dest, const char *src)
+char *strcpy(char *dest, const char *src)
 {
-  reg_char c;
-  char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
-  const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
-  size_t n;
+	char *dst = dest;
 
-  do
-    {
-      c = *s++;
-      s[off] = c;
-    }
-  while (c != '\0');
+	while ((*dst = *src) != '\0') {
+		src++;
+		dst++;
+	}
 
-  n = s - src;
-  (void) CHECK_BOUNDS_HIGH (src + n);
-  (void) CHECK_BOUNDS_HIGH (dest + n);
-
-  return dest;
+	return dest;
 }
 libc_hidden_def(strcpy)

Modified: trunk/uClibc/libc/sysdeps/linux/common/sigqueue.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/common/sigqueue.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libc/sysdeps/linux/common/sigqueue.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -48,7 +48,7 @@
   info.si_uid = getuid ();
   info.si_value = val;
 
-  return __libc_rt_sigqueueinfo(pid, sig, __ptrvalue (&info));
+  return __libc_rt_sigqueueinfo(pid, sig, &info);
 }
 
 #endif

Modified: trunk/uClibc/libc/sysdeps/linux/x86_64/brk.c
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/x86_64/brk.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libc/sysdeps/linux/x86_64/brk.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -25,19 +25,20 @@
 void *__curbrk attribute_hidden = 0;
 
 /* libc_hidden_proto(brk) */
-int brk (void *addr)
+int brk(void *addr)
 {
-	void *__unbounded newbrk;
+	void *newbrk;
 
 	__asm__ ("syscall\n"
-	     : "=a" (newbrk)
-	     : "0" (__NR_brk), "D" (__ptrvalue (addr))
-	     : "r11","rcx","memory");
+		: "=a" (newbrk)
+		: "0" (__NR_brk), "D" (addr)
+		: "r11", "rcx"
+	);
 
 	__curbrk = newbrk;
 
 	if (newbrk < addr) {
-		__set_errno (ENOMEM);
+		__set_errno(ENOMEM);
 		return -1;
 	}
 

Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/execve.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -24,50 +24,18 @@
 #include <sys/syscall.h>
 #include <bp-checks.h>
 
-extern int __syscall_execve (const char *__unbounded file,
-			     char *__unbounded const *__unbounded argv,
-			     char *__unbounded const *__unbounded envp);
-extern void __pthread_kill_other_threads_np (void);
-weak_extern (__pthread_kill_other_threads_np)
+extern int __syscall_execve(const char *file,
+			char *const *argv,
+			char *const *envp);
+extern void __pthread_kill_other_threads_np(void);
+weak_extern(__pthread_kill_other_threads_np)
 
-
 int
-__execve (file, argv, envp)
-     const char *file;
-     char *const argv[];
-     char *const envp[];
+__execve(const char *file, char *const argv[], char *const envp[])
 {
-  /* If this is a threaded application kill all other threads.  */
-  if (__pthread_kill_other_threads_np)
-    __pthread_kill_other_threads_np ();
-#if __BOUNDED_POINTERS__
-  {
-    char *const *v;
-    int i;
-    char *__unbounded *__unbounded ubp_argv;
-    char *__unbounded *__unbounded ubp_envp;
-    char *__unbounded *__unbounded ubp_v;
-
-    for (v = argv; *v; v++)
-      ;
-    i = v - argv + 1;
-    ubp_argv = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_argv) * i);
-    for (v = argv, ubp_v = ubp_argv; --i; v++, ubp_v++)
-      *ubp_v = CHECK_STRING (*v);
-    *ubp_v = 0;
-
-    for (v = envp; *v; v++)
-      ;
-    i = v - envp + 1;
-    ubp_envp = (char *__unbounded *__unbounded) alloca (sizeof (*ubp_envp) * i);
-    for (v = envp, ubp_v = ubp_envp; --i; v++, ubp_v++)
-      *ubp_v = CHECK_STRING (*v);
-    *ubp_v = 0;
-
-    return INLINE_SYSCALL (execve, 3, CHECK_STRING (file), ubp_argv, ubp_envp);
-  }
-#else
-  return INLINE_SYSCALL (execve, 3, file, argv, envp);
-#endif
+	/* If this is a threaded application kill all other threads.  */
+	if (__pthread_kill_other_threads_np)
+		__pthread_kill_other_threads_np();
+	return INLINE_SYSCALL(execve, 3, file, argv, envp);
 }
-weak_alias (__execve, execve)
+weak_alias(__execve, execve)

Modified: trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c
===================================================================
--- trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c	2008-12-12 14:23:17 UTC (rev 24394)
+++ trunk/uClibc/libpthread/linuxthreads/sysdeps/unix/sysv/linux/sigwait.c	2008-12-12 14:48:10 UTC (rev 24395)
@@ -26,8 +26,8 @@
 #include <bp-checks.h>
 #include <bits/libc-lock.h>
 
-extern int __syscall_rt_sigtimedwait (const sigset_t *__unbounded, siginfo_t *__unbounded,
-				      const struct timespec *__unbounded, size_t);
+extern int __syscall_rt_sigtimedwait (const sigset_t *, siginfo_t *,
+				      const struct timespec *, size_t);
 
 
 /* Return any pending signal or wait for one for the given time.  */




More information about the uClibc-cvs mailing list