aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>2002-12-01 17:36:18 +0000
committerBruce Evans <bde@FreeBSD.org>2002-12-01 17:36:18 +0000
commit4ce32d5dee4ff2b999e547d8ba0567a06f95ec4b (patch)
treee79c67a359456568c0428bd10043f3ae9208944f /lib
parentd5d6dee1ca95f68d8685f4bd288de754f6d60391 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/amd64/crt1.c33
-rw-r--r--lib/csu/i386-elf/crt1.c33
2 files changed, 0 insertions, 66 deletions
diff --git a/lib/csu/amd64/crt1.c b/lib/csu/amd64/crt1.c
index 43adc10e9515..a9caf9e40dab 100644
--- a/lib/csu/amd64/crt1.c
+++ b/lib/csu/amd64/crt1.c
@@ -100,40 +100,7 @@ _start(char *ap, ...)
monstartup(&eprol, &etext);
#endif
_init();
-#ifndef __GNUC__
exit( main(argc, argv, env) );
-#else
- /*
- * Some versions of gcc-2 expect the stack frame to be aligned as
- * follows after it is set up in main():
- *
- * +--------------+ <--- aligned by PREFERRED_STACK_BOUNDARY
- * +%ebp (if any) +
- * +--------------+
- * |return address|
- * +--------------+
- * | arguments |
- * | : |
- * | : |
- * +--------------+
- *
- * We implement the above to fix just the usual case in FreeBSD-4.
- * Alignment for main() is too compiler-dependent to handle correctly
- * in all cases here (or in the kernel). E.g., a different alignment
- * is required for at least gcc-2.95.4 even for the small variation
- * of compiling main() with -fomit-frame-pointer.
- */
- __asm__("
- andl $~0xf, %%esp # align stack to 16-byte boundary
- subl $12+12, %%esp # space for args and padding
- movl %0, 0(%%esp)
- movl %1, 4(%%esp)
- movl %2, 8(%%esp)
- call main
- movl %%eax, 0(%%esp)
- call exit
- " : : "r" (argc), "r" (argv), "r" (env) : "ax", "cx", "dx", "memory");
-#endif
}
#ifdef GCRT
diff --git a/lib/csu/i386-elf/crt1.c b/lib/csu/i386-elf/crt1.c
index 43adc10e9515..a9caf9e40dab 100644
--- a/lib/csu/i386-elf/crt1.c
+++ b/lib/csu/i386-elf/crt1.c
@@ -100,40 +100,7 @@ _start(char *ap, ...)
monstartup(&eprol, &etext);
#endif
_init();
-#ifndef __GNUC__
exit( main(argc, argv, env) );
-#else
- /*
- * Some versions of gcc-2 expect the stack frame to be aligned as
- * follows after it is set up in main():
- *
- * +--------------+ <--- aligned by PREFERRED_STACK_BOUNDARY
- * +%ebp (if any) +
- * +--------------+
- * |return address|
- * +--------------+
- * | arguments |
- * | : |
- * | : |
- * +--------------+
- *
- * We implement the above to fix just the usual case in FreeBSD-4.
- * Alignment for main() is too compiler-dependent to handle correctly
- * in all cases here (or in the kernel). E.g., a different alignment
- * is required for at least gcc-2.95.4 even for the small variation
- * of compiling main() with -fomit-frame-pointer.
- */
- __asm__("
- andl $~0xf, %%esp # align stack to 16-byte boundary
- subl $12+12, %%esp # space for args and padding
- movl %0, 0(%%esp)
- movl %1, 4(%%esp)
- movl %2, 8(%%esp)
- call main
- movl %%eax, 0(%%esp)
- call exit
- " : : "r" (argc), "r" (argv), "r" (env) : "ax", "cx", "dx", "memory");
-#endif
}
#ifdef GCRT