From: John Hodge Date: Tue, 31 Jul 2012 03:18:41 +0000 (+0800) Subject: Usermode/ld-acess - Removed libgcc exports X-Git-Tag: rel0.15~706^2~93 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=1ef30cd419a57385262bca994d6c96cc916b3933;p=tpg%2Facess2.git Usermode/ld-acess - Removed libgcc exports --- diff --git a/Usermode/Libraries/Makefile.tpl b/Usermode/Libraries/Makefile.tpl index 54b203ab..7687f2e1 100644 --- a/Usermode/Libraries/Makefile.tpl +++ b/Usermode/Libraries/Makefile.tpl @@ -37,7 +37,7 @@ endif $(_BIN): $(OBJ) $(_LIBS) @mkdir -p $(dir $(_BIN)) @echo [LD] -o $(BIN) $(OBJ) - @$(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) + $(LD) $(LDFLAGS) -o $(_BIN) $(OBJ) $(shell $(CC) -print-libgcc-file-name) @$(DISASM) -S $(_BIN) > $(_OBJPREFIX)$(BIN).dsm $(_OBJPREFIX)%.o: %.c diff --git a/Usermode/Libraries/ld-acess.so_src/Makefile b/Usermode/Libraries/ld-acess.so_src/Makefile index 44af24a9..d451b2c1 100644 --- a/Usermode/Libraries/ld-acess.so_src/Makefile +++ b/Usermode/Libraries/ld-acess.so_src/Makefile @@ -20,7 +20,7 @@ include ../Makefile.tpl # create libld-acess.so $(_XBIN): $(_OBJPREFIX)_stublib.o @echo [LD] -o -shared libld-acess.so - $(LD) -shared -o $@ $< + $(LD) -shared -o $@ $< $(LDFLAGS) # @$(LD) $(LDFLAGS) -o $@ $(OBJ) diff --git a/Usermode/Libraries/ld-acess.so_src/_stublib.c b/Usermode/Libraries/ld-acess.so_src/_stublib.c index abf80435..40967680 100644 --- a/Usermode/Libraries/ld-acess.so_src/_stublib.c +++ b/Usermode/Libraries/ld-acess.so_src/_stublib.c @@ -14,6 +14,7 @@ int _errno; #include "arch/syscalls.s.h" // libgcc functions +#if 0 uint64_t __udivdi3(uint64_t Num, uint64_t Den){return 0;} uint64_t __umoddi3(uint64_t Num, uint64_t Den){return 0;} @@ -21,6 +22,7 @@ int32_t __divsi3(int32_t Num, int32_t Den){return 0;} int32_t __modsi3(int32_t Num, int32_t Den){return 0;} uint32_t __udivsi3(uint32_t Num, uint32_t Den){return 0;} uint32_t __umodsi3(uint32_t Num, uint32_t Den){return 0;} +#endif void *_crt0_exit_handler; diff --git a/Usermode/Libraries/ld-acess.so_src/export.c b/Usermode/Libraries/ld-acess.so_src/export.c index 1062d7e4..32f70d22 100644 --- a/Usermode/Libraries/ld-acess.so_src/export.c +++ b/Usermode/Libraries/ld-acess.so_src/export.c @@ -23,6 +23,7 @@ const struct { } caLocalExports[] = { EXP(gLoadedLibraries), EXP(_exit), + EXP(_errno), EXP(clone), EXP(kill), EXP(yield), @@ -75,12 +76,14 @@ const struct { EXP(_SysAllocate), EXP(_SysDebug), +#if 0 EXP(__umoddi3), EXP(__udivdi3), EXP(__divsi3), EXP(__modsi3), EXP(__udivsi3), EXP(__umodsi3) +#endif }; const int ciNumLocalExports = sizeof(caLocalExports)/sizeof(caLocalExports[0]); diff --git a/Usermode/Libraries/ld-acess.so_src/lib.c b/Usermode/Libraries/ld-acess.so_src/lib.c index da37dea0..06721026 100644 --- a/Usermode/Libraries/ld-acess.so_src/lib.c +++ b/Usermode/Libraries/ld-acess.so_src/lib.c @@ -112,6 +112,7 @@ uint64_t __divmod64(uint64_t Num, uint64_t Den, uint64_t *Rem) return ret; } +#if 0 uint32_t __divmod32(uint32_t Num, uint32_t Den, uint32_t *Rem) { uint32_t ret = 0, add = 1; @@ -198,4 +199,5 @@ uint32_t __umodsi3(uint32_t Num, uint32_t Den) __divmod32(Num, Den, &ret); return ret; } +#endif diff --git a/Usermode/Libraries/libc.so_src/include_exp/stdlib.h b/Usermode/Libraries/libc.so_src/include_exp/stdlib.h index 0e6d9e03..8acfb8bc 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/stdlib.h +++ b/Usermode/Libraries/libc.so_src/include_exp/stdlib.h @@ -20,10 +20,15 @@ /* --- StdLib --- */ extern void _exit(int code) __attribute__((noreturn)); /* NOTE: Also defined in acess/sys.h */ +extern long long strtoll(const char *ptr, char **end, int base); +extern long strtol(const char *ptr, char **end, int base); extern int atoi(const char *ptr); extern void exit(int status) __attribute__((noreturn)); extern void atexit(void (*__func)(void)); extern void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *)); +extern int abs(int j); +extern long int labs(long int j); +extern long long int llabs(long long int j); /* --- Environment --- */ extern char *getenv(const char *name);