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

147e83
commit c2d549290d24aeae30a328a6b4061f60f095dea2
147e83
Author: Joseph Myers <joseph@codesourcery.com>
147e83
Date:   Thu Jan 31 22:57:06 2013 +0000
147e83
147e83
    Remove bp-thunks code.
147e83
147e83
Conflicts:
147e83
	sysdeps/generic/bp-thunks.h
147e83
147e83
Copyright header change; file removed manually.
147e83
147e83
diff --git a/Makerules b/Makerules
147e83
index 9e572f48728b0f56..9bd7d603fc28a4de 100644
147e83
--- a/Makerules
147e83
+++ b/Makerules
147e83
@@ -419,19 +419,15 @@ static-only-routines =
147e83
 endif
147e83
 endif
147e83
 
147e83
-# Bounded pointer thunks are only built for *.ob
147e83
-elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks))
147e83
-
147e83
 elide-routines.oS += $(filter-out $(static-only-routines),\
147e83
-				  $(routines) $(aux) $(sysdep_routines)) \
147e83
-		     $(elide-bp-thunks)
147e83
-elide-routines.os += $(static-only-routines) $(elide-bp-thunks)
147e83
+				  $(routines) $(aux) $(sysdep_routines))
147e83
+elide-routines.os += $(static-only-routines)
147e83
 
147e83
 # If we have versioned code we don't need the old versions in any of the
147e83
 # static libraries.
147e83
-elide-routines.o  += $(shared-only-routines) $(elide-bp-thunks)
147e83
-elide-routines.op += $(shared-only-routines) $(elide-bp-thunks)
147e83
-elide-routines.og += $(shared-only-routines) $(elide-bp-thunks)
147e83
+elide-routines.o  += $(shared-only-routines)
147e83
+elide-routines.op += $(shared-only-routines)
147e83
+elide-routines.og += $(shared-only-routines)
147e83
 elide-routines.ob += $(shared-only-routines)
147e83
 
147e83
 # Shared library building.
147e83
@@ -639,11 +635,7 @@ headers := $(headers) $(sysdep_headers)
147e83
 
147e83
 # This is the list of all object files, gotten by
147e83
 # replacing every ".c" in `sources' with a ".o".
147e83
-# We also add bounded-pointer thunks, which are later
147e83
-# elided for all suffixes except for `.ob'.
147e83
-override objects := $(addprefix $(objpfx),$(sources:.c=.o) \
147e83
-		      $(patsubst %,$(bppfx)%.o,\
147e83
-			$(filter $(routines) $(sysdep_routines),$(bp-thunks))))
147e83
+override objects := $(addprefix $(objpfx),$(sources:.c=.o))
147e83
 
147e83
 
147e83
 # The makefile may define $(extra-libs) with `libfoo libbar'
147e83
diff --git a/sysdeps/generic/bp-thunks.h b/sysdeps/generic/bp-thunks.h
147e83
deleted file mode 100644
147e83
index 1c9bba21c80387a5..0000000000000000
147e83
--- a/sysdeps/generic/bp-thunks.h
147e83
+++ /dev/null
147e83
@@ -1,69 +0,0 @@
147e83
-/* Bounded-pointer syscall thunk support.
147e83
-   Copyright (C) 2000, 2003 Free Software Foundation, Inc.
147e83
-   This file is part of the GNU C Library.
147e83
-   Contributed by Greg McGary <greg@mcgary.org>
147e83
-
147e83
-   The GNU C Library is free software; you can redistribute it and/or
147e83
-   modify it under the terms of the GNU Lesser General Public
147e83
-   License as published by the Free Software Foundation; either
147e83
-   version 2.1 of the License, or (at your option) any later version.
147e83
-
147e83
-   The GNU C Library is distributed in the hope that it will be useful,
147e83
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
147e83
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
147e83
-   Lesser General Public License for more details.
147e83
-
147e83
-   You should have received a copy of the GNU Lesser General Public
147e83
-   License along with the GNU C Library; if not, see
147e83
-   <http://www.gnu.org/licenses/>.  */
147e83
-
147e83
-#ifndef _bpthunks_h_
147e83
-#define _bpthunks_h_
147e83
-
147e83
-#ifndef __ASSEMBLER__
147e83
-
147e83
-/* This header is included by the syscall BP thunks defined in
147e83
-   sysd-syscalls, as created by sysdeps/unix/make-syscalls.sh.  It
147e83
-   includes all headers that contain prototype declarations for system
147e83
-   call functions.  */
147e83
-
147e83
-#include <libc-symbols.h>
147e83
-#include <bp-sym.h>
147e83
-#include <bp-checks.h>
147e83
-
147e83
-/* Get `struct timeval' definition for select.  */
147e83
-#define __need_timeval
147e83
-#include <bits/time.h>
147e83
-
147e83
-#include <stddef.h>
147e83
-#include <unistd.h>
147e83
-#include <sched.h>
147e83
-#include <signal.h>
147e83
-#include <fcntl.h>
147e83
-#include <time.h>
147e83
-#include <utime.h>
147e83
-#include <stdio.h>
147e83
-
147e83
-#include <sys/types.h>
147e83
-#include <sys/ioctl.h>
147e83
-#include <sys/klog.h>
147e83
-#include <sys/mman.h>
147e83
-#include <sys/mount.h>
147e83
-#include <sys/quota.h>
147e83
-#include <sys/resource.h>
147e83
-#include <sys/select.h>
147e83
-#include <io/sys/sendfile.h>
147e83
-#include <sys/socket.h>
147e83
-#include <sys/stat.h>
147e83
-#include <sys/statfs.h>
147e83
-#include <sys/swap.h>
147e83
-#include <sys/sysinfo.h>
147e83
-#include <sys/time.h>
147e83
-#include <sys/times.h>
147e83
-#include <sys/timex.h>
147e83
-#include <sys/utsname.h>
147e83
-#include <sys/wait.h>
147e83
-
147e83
-#endif /* Not __ASSEMBLER__.  */
147e83
-
147e83
-#endif /* _bpthunks_h_ */
147e83
diff --git a/sysdeps/unix/Makefile b/sysdeps/unix/Makefile
147e83
index 0ba5dcbcac323bb0..b369128d0cb6c2e7 100644
147e83
--- a/sysdeps/unix/Makefile
147e83
+++ b/sysdeps/unix/Makefile
147e83
@@ -89,21 +89,10 @@ $(common-objpfx)sysd-syscalls: $(..)sysdeps/unix/make-syscalls.sh \
147e83
 	mv -f $@T $@
147e83
 endif
147e83
 
147e83
-# The $(bppfx)syscall.ob objects depend on s-proto-bp.d, which are
147e83
-# generated to specify dependencies generated BP stubs have on headers.
147e83
-# These deps use file names relative to a subdir, so don't
147e83
-# include them in the parent directory.
147e83
-ifneq (,$(filter $(unix-syscalls),$(routines) $(sysdep_routines) $(aux)))
147e83
-ifndef no_deps
147e83
--include $(common-objpfx)s-proto-bp.d
147e83
-endif
147e83
-endif
147e83
-
147e83
 $(common-objpfx)s-%.d: $(..)sysdeps/unix/s-%.S \
147e83
 		       $(wildcard $(+sysdep_dirs:%=%/syscalls.list))
147e83
 	$(+make-deps)
147e83
 
147e83
-common-generated += s-proto-bp.d
147e83
 postclean-generated += sysd-syscalls
147e83
 
147e83
 endif
147e83
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
147e83
index 2c701a2bf59183b2..4ec17c99bc16eaee 100644
147e83
--- a/sysdeps/unix/make-syscalls.sh
147e83
+++ b/sysdeps/unix/make-syscalls.sh
147e83
@@ -36,10 +36,6 @@
147e83
 # W: wait status, optionally-NULL pointer to int (e.g., 2nd arg of wait4)
147e83
 #
147e83
 
147e83
-ptr='[abBfFINpPsSWV]'	# all pointer keyletters
147e83
-int='[inv]'		# all scalar keyletters
147e83
-typ='[ifnNpP]'		# typed-arg keyletters: we capture type for use in thunk
147e83
-
147e83
 ##############################################################################
147e83
 
147e83
 thisdir=$1; shift
147e83
@@ -313,114 +309,4 @@ while read file srcfile caller syscall args strong weak; do
147e83
  ;;
147e83
  esac
147e83
 
147e83
-  case x"$callnum",$srcfile,$args in
147e83
-  x[_-],-,* | x*,*.[sS],*V*) ;;
147e83
-  x*,-,*$ptr* | x*,*.[sS],*$ptr*)
147e83
-
147e83
-    nv_weak=`for name in $weak; do
147e83
-		case $name in
147e83
-		*@*) ;;
147e83
-		*) echo $name;;
147e83
-	        esac; done`
147e83
-
147e83
-    # choose the name with the fewest leading underscores, preferably none
147e83
-    set `echo $strong $nv_weak |tr '@ \t' ' \n\n' |sort -r`
147e83
-    callname=$1
147e83
-
147e83
-    # convert signature string to individual numbered arg names
147e83
-    # e.g., i:ipbN -> i0 i1 p2 b3 N4
147e83
-    set `echo $args |
147e83
-	sed -e 's/^\(.\):\(.*\)/\2 <\10>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\11>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\12>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\13>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\14>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\15>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\16>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\17>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\18>/' \
147e83
-	    -e 's/^\([^ ]\)\(.*\)/\2 <\19>/'`
147e83
-    rtn=$1; shift
147e83
-    args=$*
147e83
-    arglist=`echo $* |sed 's/ /, /g'`
147e83
-
147e83
-    # The best way to understand what's going on here is to examine
147e83
-    # the output in BUILDDIR/sysd-syscalls.
147e83
-
147e83
-    # generate makefile envelope & rule head
147e83
-    echo "ifeq (,\$(filter $file,\$(bp-thunks)))"
147e83
-    echo "bp-thunks += $file"
147e83
-    echo "\$(objpfx)\$(bppfx)$file.ob: \$(common-objpfx)s-proto-bp.d"
147e83
-
147e83
-    # generate macro head
147e83
-    echo "	(echo '#define $callname(`echo $arglist | \
147e83
-	    sed -e 's/[<>]//g'`) `echo $rtn | \
147e83
-	    sed -e 's/<\('$typ'0\)>/\1v;/g' \
147e83
-		-e 's/<\(b0\)>/x0; extern char \1v;/g'` \\'; \\"
147e83
-
147e83
-    # generate extern decls of dummy variables for each arg
147e83
-    echo "	 echo '`echo $args | \
147e83
-	    sed -e 's/<\('$typ'[1-9]\)>/extern \1, \1v;/g' \
147e83
-		-e 's/<\([abBFIsSV][1-9]\)>/extern char \1v;/g' \
147e83
-		-e 's/<\([Wv][1-9]\)>/extern int \1v;/g'` \\'; \\"
147e83
-
147e83
-    # generate bounded-pointer thunk declarator
147e83
-    echo "	 echo '`echo $rtn | \
147e83
-	    sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__bounded/g' \
147e83
-		-e 's/<\('$int'0\)>/__typeof (\1v)/g'` BP_SYM ($strong) (`echo $arglist | \
147e83
-	    sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__bounded \1a/g' \
147e83
-		-e 's/<\('$int'[1-9]\)>/__typeof (\1v) \1a/g'`) { \\'; \\"
147e83
-
147e83
-    # generate extern primitive syscall declaration
147e83
-    echo "	 echo '  extern `echo $rtn | \
147e83
-	    sed -e 's/<\('$ptr'0\)>/__typeof (\1v) *__unbounded/g' \
147e83
-		-e 's/<\('$int'0\)>/__typeof (\1v)/g'` ($callname) (`echo $arglist | \
147e83
-	    sed -e 's/<\('$ptr'[1-9]\)>/__typeof (\1v) *__unbounded/g' \
147e83
-		-e 's/<\('$int'[1-9]\)>/__typeof (\1v)/g'`); \\'; \\"
147e83
-
147e83
-    # generate call the primtive system call, optionally wrapping bounds
147e83
-    # around the result if the signature's return keyletter is `b'.
147e83
-    echo "	 echo '  return `echo $rtn |
147e83
-	    sed -e 's/<b0>/BOUNDED_N (/' \
147e83
-		-e 's/<.0>//'`($callname) (`echo $arglist | \
147e83
-	    sed -e 's/<\(a[1-9]\)>/__ptrvalue (\1a)/g' \
147e83
-		-e 's/<\(n[1-9]\)>, <\(V[1-9]\)>/\1a, CHECK_N_PAGES (\2a, \1a)/g' \
147e83
-		-e 's/<\(b[1-9]\)>, <\(n[1-9]\)>/CHECK_N (\1a, \2a), \2a/g' \
147e83
-		-e 's/<\(b[1-9]\)>, <\(N[1-9]\)>/CHECK_N (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \
147e83
-		-e 's/<\(B[1-9]\)>, <\(n[1-9]\)>/CHECK_N_NULL_OK (\1a, \2a), \2a/g' \
147e83
-		-e 's/<\(B[1-9]\)>, <\(N[1-9]\)>/CHECK_N_NULL_OK (\1a, *CHECK_1 (\2a)), __ptrvalue (\2a)/g' \
147e83
-		-e 's/<\(f[1-9]\)>/CHECK_N (\1a, 2)/g' \
147e83
-		-e 's/<\(i[1-9]\)>, <\(F[1-9]\)>/\1a, CHECK_FCNTL (\2a, \1a)/g' \
147e83
-		-e 's/<\(i[1-9]\)>, <\(I[1-9]\)>/\1a, CHECK_IOCTL (\2a, \1a)/g' \
147e83
-		-e 's/<\(p[1-9]\)>/CHECK_1 (\1a)/g' \
147e83
-		-e 's/<\([PW][1-9]\)>/CHECK_1_NULL_OK (\1a)/g' \
147e83
-		-e 's/<\(s[1-9]\)>/CHECK_STRING (\1a)/g' \
147e83
-		-e 's/<\(S[1-9]\)>/CHECK_STRING_NULL_OK (\1a)/g' \
147e83
-		-e 's/<\([ivn][1-9]\)>/\1a/g'`)`echo $rtn $args |
147e83
-	    sed -e 's/<b0>.*<\(n[1-9]\)>.*/, \1a)/' \
147e83
-		-e 's/<.0>.*//'`; \\'; \\"
147e83
-
147e83
-    echo "	 echo '} \\'; \\"
147e83
-
147e83
-    echo "	 echo 'libc_hidden_def (BP_SYM ($strong)) \\'; \\"
147e83
-
147e83
-    # generate thunk aliases
147e83
-    for name in $nv_weak; do
147e83
-      echo "	 echo 'weak_alias (BP_SYM ($strong), BP_SYM ($name)) \\'; \\"
147e83
-      echo "	 echo 'libc_hidden_weak (BP_SYM ($name)) \\'; \\"
147e83
-    done
147e83
-
147e83
-    # wrap up
147e83
-    echo "\
147e83
-	 echo ''; \\
147e83
-	 echo '#include <bp-thunks.h>'; \\
147e83
-	) | \$(COMPILE.c) -x c -o \$@ -"
147e83
-### Use this for debugging intermediate output:
147e83
-### 	) >\$(@:.ob=.c)
147e83
-### 	\$(subst -c,-E,\$(COMPILE.c)) -o \$(@:.ob=.ib) \$(@:.ob=.c)
147e83
-### 	\$(COMPILE.c) -x cpp-output -o \$@ \$(@:.ob=.ib)"
147e83
-    echo endif
147e83
-    ;;
147e83
-  esac
147e83
-
147e83
 done
147e83
diff --git a/sysdeps/unix/s-proto-bp.S b/sysdeps/unix/s-proto-bp.S
147e83
deleted file mode 100644
147e83
index ba0363e16ffc4bd8..0000000000000000
147e83
--- a/sysdeps/unix/s-proto-bp.S
147e83
+++ /dev/null
147e83
@@ -1,4 +0,0 @@
147e83
-/* This file exists just to have its dependencies determined.
147e83
-   Those dependencies are then used for the bp thunk objects.  */
147e83
-
147e83
-#include <bp-thunks.h>
147e83
diff --git a/sysdeps/unix/sysv/linux/i386/bp-thunks.h b/sysdeps/unix/sysv/linux/i386/bp-thunks.h
147e83
deleted file mode 100644
147e83
index 59a42ddefe8ed33e..0000000000000000
147e83
--- a/sysdeps/unix/sysv/linux/i386/bp-thunks.h
147e83
+++ /dev/null
147e83
@@ -1,4 +0,0 @@
147e83
-#ifndef __ASSEMBLER__
147e83
-# include <sysdeps/generic/bp-thunks.h>
147e83
-# include <sys/vm86.h>
147e83
-#endif