diff options
author | hpa <hpa> | 2004-12-16 21:53:20 +0000 |
---|---|---|
committer | hpa <hpa> | 2004-12-16 21:53:20 +0000 |
commit | 7a1ffa4627aae0b2d911b70ab45c47cc34203277 (patch) | |
tree | 8c833c8d523369a72d8964d57d68f93874004321 /dos | |
parent | 426289c1a0b5f6ce7a04c2c02329f8108db7f033 (diff) | |
download | syslinux-7a1ffa4627aae0b2d911b70ab45c47cc34203277.tar.gz syslinux-7a1ffa4627aae0b2d911b70ab45c47cc34203277.tar.xz syslinux-7a1ffa4627aae0b2d911b70ab45c47cc34203277.zip |
Convert to using -mregparm=3; makes the code slightly smaller AND
avoids some stupid problems with .code16 on some binutils versions.
Diffstat (limited to 'dos')
-rw-r--r-- | dos/Makefile | 2 | ||||
-rw-r--r-- | dos/crt0.S | 17 |
2 files changed, 12 insertions, 7 deletions
diff --git a/dos/Makefile b/dos/Makefile index b54098ae..b2b69830 100644 --- a/dos/Makefile +++ b/dos/Makefile @@ -1,4 +1,4 @@ -CC = gcc -m32 +CC = gcc -m32 -mregparm=3 LD = ld -m elf_i386 OBJCOPY = objcopy OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer @@ -4,6 +4,9 @@ .globl _start .type _start,@function _start: + # Align the stack and make sure the high half is zero + andl $0xfff8,%esp + # Clear the .bss cld xorl %eax,%eax @@ -51,20 +54,22 @@ _start: calll __init_memory_arena # Now call main... - pushl $argv # Push argv - pushl %eax # Dummy argc (we dont look at it) + movl $argv,%edx # argv + xorl %eax,%eax # dummy argc (we dont use it) calll main - pushl %eax - calll exit - hlt + + # Here %eax is the exit code, fall through into exit + .size _start,.-_start .globl exit .type exit,@function exit: - movb 4(%esp),%al + # Exit code already in %eax movb $0x4c,%ah # Terminate program int $0x21 +1: hlt + jmp 1b .size exit,.-exit .section ".bss","aw" |