From owner-p4-projects@FreeBSD.ORG Mon Nov 9 16:47:37 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A3E3A10656A5; Mon, 9 Nov 2009 16:47:37 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FCA81065697 for ; Mon, 9 Nov 2009 16:47:37 +0000 (UTC) (envelope-from jona@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 331818FC20 for ; Mon, 9 Nov 2009 16:47:37 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id nA9GlbMi017191 for ; Mon, 9 Nov 2009 16:47:37 GMT (envelope-from jona@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id nA9Glbu3017189 for perforce@freebsd.org; Mon, 9 Nov 2009 16:47:37 GMT (envelope-from jona@FreeBSD.org) Date: Mon, 9 Nov 2009 16:47:37 GMT Message-Id: <200911091647.nA9Glbu3017189@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jona@FreeBSD.org using -f From: Jonathan Anderson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 170405 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Nov 2009 16:47:38 -0000 http://p4web.freebsd.org/chv.cgi?CH=170405 Change 170405 by jona@jona-capsicum-kent on 2009/11/09 16:47:10 Removed the multiple definitions which snuck in here Affected files ... .. //depot/projects/trustedbsd/capabilities/src/lib/csu/amd64/crt1.c#4 edit .. //depot/projects/trustedbsd/capabilities/src/lib/csu/common/crtbrand.c#5 edit .. //depot/projects/trustedbsd/capabilities/src/lib/csu/i386-elf/crt1.c#4 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/lib/csu/amd64/crt1.c#4 (text+ko) ==== @@ -134,42 +134,4 @@ exit( cap_main(argc, argv, env) ); } - -/* The Capsicum entry function. */ -void -_capstart(char **ap, void (*cleanup)(void)) -{ - int argc; - char **argv; - char **env; - const char *s; - - argc = *(long *)(void *)ap; - argv = ap + 1; - env = ap + 2 + argc; - environ = env; - if (argc > 0 && argv[0] != NULL) { - __progname = argv[0]; - for (s = __progname; *s != '\0'; s++) - if (*s == '/') - __progname = s + 1; - } - - if (&_DYNAMIC != NULL) - atexit(cleanup); - else - _init_tls(); - -#ifdef GCRT - atexit(_mcleanup); -#endif - atexit(_fini); -#ifdef GCRT -/* monstartup(&eprol, &etext); -__asm__("eprol:");*/ /* XXX: does this interfere with profiling? */ -#endif - _init(); - exit( cap_main(argc, argv, env) ); -} - __asm__(".ident\t\"$FreeBSD: src/lib/csu/amd64/crt1.c,v 1.15 2005/10/07 22:13:17 bde Exp $\""); ==== //depot/projects/trustedbsd/capabilities/src/lib/csu/common/crtbrand.c#5 (text+ko) ==== @@ -62,17 +62,3 @@ write(2, warning, sizeof(warning)); } - -int cap_main(int argc, char **argv, char **env) -{ - const char warning[] = - "ERROR: attempting to run a regular binary in capability mode." - "\n\n" - "If you wish to run a binary in a sandbox, you must provide a " - "cap_main() function which takes the same arguments as main()." - "\n"; - - write(2, warning, sizeof(warning)); - return 1; -} - ==== //depot/projects/trustedbsd/capabilities/src/lib/csu/i386-elf/crt1.c#4 (text+ko) ==== @@ -155,49 +155,4 @@ exit( cap_main(argc, argv, env) ); } - - - -/* The Capsicum entry function. */ -void -_capstart(char *ap, ...) -{ - fptr cleanup; - int argc; - char **argv; - char **env; - const char *s; - -#ifdef __GNUC__ - __asm__("and $0xfffffff0,%esp"); -#endif - cleanup = get_rtld_cleanup(); - argv = ≈ - argc = *(long *)(void *)(argv - 1); - env = argv + argc + 1; - environ = env; - if (argc > 0 && argv[0] != NULL) { - __progname = argv[0]; - for (s = __progname; *s != '\0'; s++) - if (*s == '/') - __progname = s + 1; - } - - if (&_DYNAMIC != NULL) - atexit(cleanup); - else - _init_tls(); - -#ifdef GCRT - atexit(_mcleanup); -#endif - atexit(_fini); -#ifdef GCRT -/* monstartup(&eprol, &etext); -__asm__("eprol:");*/ /* XXX: does this interfere with profiling? */ -#endif - _init(); - exit( cap_main(argc, argv, env) ); -} - __asm__(".ident\t\"$FreeBSD: src/lib/csu/i386-elf/crt1.c,v 1.15 2005/10/07 22:13:17 bde Exp $\"");