From 8a8af03dce9fff80cd1adf38d2ddeae2cdc33d9e Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Wed, 29 Jun 2005 23:21:45 +0000 Subject: Add __libc_stack_end to libc. --- libc/misc/internals/Makefile | 8 ++------ libc/misc/internals/__uClibc_main.c | 3 ++- libc/misc/internals/static.c | 4 ++++ 3 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 libc/misc/internals/static.c (limited to 'libc/misc') diff --git a/libc/misc/internals/Makefile b/libc/misc/internals/Makefile index 23816b38d..933b169a6 100644 --- a/libc/misc/internals/Makefile +++ b/libc/misc/internals/Makefile @@ -31,7 +31,7 @@ OBJS=$(COBJS) OBJ_LIST=../../obj.misc.internals -all: $(OBJ_LIST) interp.o +all: $(OBJ_LIST) interp.o static.o $(OBJ_LIST): $(OBJS) echo $(patsubst %, misc/internals/%, $(OBJS)) > $(OBJ_LIST) @@ -44,11 +44,7 @@ interp.c: Makefile "(\".interp\"))) =\""$(DYNAMIC_LINKER)"\";" >> interp.c echo "#endif" >> interp.c -interp.o: interp.c - $(CC) $(CFLAGS) -c $< -o $@ - $(STRIPTOOL) -x -R .note -R .comment $*.o - -$(COBJS): %.o : %.c +$(COBJS) interp.o static.o: %.o : %.c $(CC) $(CFLAGS) -c $< -o $@ $(STRIPTOOL) -x -R .note -R .comment $*.o diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 071d6d613..21864ba4f 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -32,6 +32,7 @@ extern void __guard_setup(void); /* * Prototypes. */ +extern void *__libc_stack_end; extern void weak_function _stdio_init(void); extern int *weak_const_function __errno_location(void); extern int *weak_const_function __h_errno_location(void); @@ -172,7 +173,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, unsigned long *aux_dat; Elf32_auxv_t auxvt[AT_EGID + 1]; #endif - + __libc_stack_end = stack_end; /* We need to initialize uClibc. If we are dynamically linked this * may have already been completed by the shared lib loader. We call * __uClibc_init() regardless, to be sure the right thing happens. */ diff --git a/libc/misc/internals/static.c b/libc/misc/internals/static.c new file mode 100644 index 000000000..cd39ffdd7 --- /dev/null +++ b/libc/misc/internals/static.c @@ -0,0 +1,4 @@ +#include + +/* Force static libraries to know about ... */ +void *__libc_stack_end=NULL; -- cgit v1.2.3