summaryrefslogtreecommitdiff
path: root/com32
diff options
context:
space:
mode:
authorhpa <hpa>2004-12-17 19:44:36 +0000
committerhpa <hpa>2004-12-17 19:44:36 +0000
commit1a145fec7f8057933fa0fd9df24aa14ac5a7159e (patch)
treec3299d3f67dba7e0c70ea15f2d1567c9e626efeb /com32
parent6c1c1c0f31cda997a0841c76d413fa00bbfde355 (diff)
downloadsyslinux-1a145fec7f8057933fa0fd9df24aa14ac5a7159e.tar.gz
Additional fixes for the proper argc/argv parsing
Diffstat (limited to 'com32')
-rw-r--r--com32/lib/Makefile3
-rw-r--r--com32/lib/malloc.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index 148cc2de..5f7551d4 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -16,7 +16,8 @@ LIBOBJS = abort.o atexit.o atoi.o atol.o atoll.o calloc.o creat.o \
vsscanf.o libgcc/__ashldi3.o libgcc/__udivdi3.o \
libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \
libgcc/__muldi3.o libgcc/__udivmoddi4.o libgcc/__umoddi3.o \
- libgcc/__divdi3.o libgcc/__moddi3.o sys/entry.o sys/exit.o \
+ libgcc/__divdi3.o libgcc/__moddi3.o \
+ sys/entry.o sys/exit.o sys/argv.o \
sys/fileinfo.o sys/opendev.o sys/read.o sys/write.o \
sys/close.o sys/open.o sys/fileread.o sys/fileclose.o \
sys/isatty.o sys/openconsole.o sys/line_input.o \
diff --git a/com32/lib/malloc.c b/com32/lib/malloc.c
index 4efd89c1..e7a1cdc9 100644
--- a/com32/lib/malloc.c
+++ b/com32/lib/malloc.c
@@ -22,6 +22,7 @@ struct free_arena_header __malloc_head =
/* This is extern so it can be overridden by the user application */
extern size_t __stack_size;
+extern void *__mem_end; /* Produced after argv parsing */
static inline size_t sp(void)
{
@@ -32,11 +33,10 @@ static inline size_t sp(void)
static void __constructor init_memory_arena(void)
{
- extern char _end[]; /* Symbol created by the linker */
struct free_arena_header *fp;
size_t start, total_space;
- start = (size_t)ARENA_ALIGN_UP(_end);
+ start = (size_t)ARENA_ALIGN_UP(__mem_end);
total_space = sp() - start;
if ( __stack_size == 0 || __stack_size > total_space >> 1 )