diff --git a/freeldr/freeldr/CHANGELOG b/freeldr/freeldr/CHANGELOG index 5a8d09fd973..9b540c841db 100644 --- a/freeldr/freeldr/CHANGELOG +++ b/freeldr/freeldr/CHANGELOG @@ -1,3 +1,8 @@ +Changes in v1.8.3 (3/18/2003) (brianp) + +- Added _alloca() function because Mingw32 generates code that needs it +- Defined _mainCRTStartup in fathelp.asm because Mingw32 looks for that symbol + Changes in v1.8.2 (1/24/2003) (ekohl) - Relaxed check for Int13-Extension support. diff --git a/freeldr/freeldr/Makefile b/freeldr/freeldr/Makefile index b66af39fe12..44327bc137c 100644 --- a/freeldr/freeldr/Makefile +++ b/freeldr/freeldr/Makefile @@ -205,7 +205,8 @@ ARCH_OBJS = fathelp.o \ drvmap.o \ int386.o \ i386disk.o \ - portio.o + portio.o \ + _alloca.o # For Mingw32 builds RTL_OBJS = print.o \ stdlib.o \ diff --git a/freeldr/freeldr/arch/i386/_alloca.S b/freeldr/freeldr/arch/i386/_alloca.S new file mode 100644 index 00000000000..099437475ab --- /dev/null +++ b/freeldr/freeldr/arch/i386/_alloca.S @@ -0,0 +1,32 @@ +/* stuff needed for libgcc on win32. */ + +//#ifdef L_chkstk + + .global ___chkstk + .global __alloca +___chkstk: +__alloca: + pushl %ecx /* save temp */ + movl %esp,%ecx /* get sp */ + addl $0x8,%ecx /* and point to return addr */ + +probe: cmpl $0x1000,%eax /* > 4k ?*/ + jb done + + subl $0x1000,%ecx /* yes, move pointer down 4k*/ + orl $0x0,(%ecx) /* probe there */ + subl $0x1000,%eax /* decrement count */ + jmp probe /* and do it again */ + +done: subl %eax,%ecx + orl $0x0,(%ecx) /* less that 4k, just peek here */ + + movl %esp,%eax + movl %ecx,%esp /* decrement stack */ + + movl (%eax),%ecx /* recover saved temp */ + movl 4(%eax),%eax /* get return address */ + jmp *%eax + + +//#endif diff --git a/freeldr/freeldr/arch/i386/fathelp.asm b/freeldr/freeldr/arch/i386/fathelp.asm index 805b8ad8dbd..9aedb925046 100644 --- a/freeldr/freeldr/arch/i386/fathelp.asm +++ b/freeldr/freeldr/arch/i386/fathelp.asm @@ -52,6 +52,8 @@ BootPartition equ 0x7dfd ; This code is loaded at 0000:8000 so we have to ; encode a jmp instruction to jump to 0000:8200 +global _mainCRTStartup ; For Mingw32 builds where the linker looks for this symbol +_mainCRTStartup: global start start: db 0xe9 diff --git a/freeldr/freeldr/include/version.h b/freeldr/freeldr/include/version.h index d36bc417a30..f3996a55031 100644 --- a/freeldr/freeldr/include/version.h +++ b/freeldr/freeldr/include/version.h @@ -22,7 +22,7 @@ /* just some stuff */ -#define VERSION "FreeLoader v1.8.2" +#define VERSION "FreeLoader v1.8.3" #define COPYRIGHT "Copyright (C) 1998-2003 Brian Palmer " #define AUTHOR_EMAIL "" #define BY_AUTHOR "by Brian Palmer" @@ -36,7 +36,7 @@ // #define FREELOADER_MAJOR_VERSION 1 #define FREELOADER_MINOR_VERSION 8 -#define FREELOADER_PATCH_VERSION 2 +#define FREELOADER_PATCH_VERSION 3 PUCHAR GetFreeLoaderVersionString(VOID);