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

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