PERFORCE change 170545 for review

Jonathan Anderson jona at FreeBSD.org
Thu Nov 12 14:24:29 UTC 2009


http://p4web.freebsd.org/chv.cgi?CH=170545

Change 170545 by jona at jona-capsicum-belle64 on 2009/11/12 14:23:34

	Some CSU cleanup

Affected files ...

.. //depot/projects/trustedbsd/capabilities/src/lib/csu/amd64/crt1.c#5 edit
.. //depot/projects/trustedbsd/capabilities/src/lib/csu/common/crtbrand.c#6 edit
.. //depot/projects/trustedbsd/capabilities/src/lib/csu/i386-elf/crt1.c#5 edit

Differences ...

==== //depot/projects/trustedbsd/capabilities/src/lib/csu/amd64/crt1.c#5 (text+ko) ====

@@ -44,7 +44,6 @@
 extern void _fini(void);
 extern void _init(void);
 extern int main(int, char **, char **);
-extern int cap_main(int, char **, char **) __attribute__((weak));
 extern void _start(char **, void (*)(void));
 extern void _capstart(char **, void (*)(void));
 

==== //depot/projects/trustedbsd/capabilities/src/lib/csu/common/crtbrand.c#6 (text+ko) ====

@@ -54,11 +54,14 @@
 
 
 
-int cap_main(int argc, char **argv, char **env)
+extern int cap_main(int, char **, char **) __attribute__((weak));
+int cap_main(__unused int argc, __unused char **argv, __unused char **env)
 {
 	const char warning[] =
 		"ERROR: attempting to run a regular binary in capability mode!\n\nIf you want 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#5 (text+ko) ====

@@ -43,7 +43,6 @@
 extern void _fini(void);
 extern void _init(void);
 extern int main(int, char **, char **);
-extern int cap_main(int, char **, char **) __attribute__((weak));
 extern void _start(char *, ...);
 extern void _capstart(char *, ...);
 
@@ -148,8 +147,8 @@
 #endif
 	atexit(_fini);
 #ifdef GCRT
-	monstartup(&eprol, &etext);
-__asm__("eprol:");
+/*	monstartup(&eprol, &etext);
+__asm__("eprol:");*/
 #endif
 	_init();
 	exit( cap_main(argc, argv, env) );


More information about the p4-projects mailing list