Greetings!
As I have presented in the announcement about the ELF dynamic linker
preview earlier this week, one of my tasks now is to reduce the size
of the root COM32 module to a minimum, and make the rest of the klibc
available as dynamic loadable content. After I studied the linker map
output and saw what are the minimal requirements of the dynamic linker
itself from the C library (the object files grabbed by the linker at
symbol resolution, from the archive file), I managed to reduce the
size of the COM32 module from 34K to 25K. In those 25K, however, I
also left a small part of the C library that I considered to be likely
required by future dynamic modules, which would link against the root
module services. Without this additional code, the minimal size of the
module would have been 15K (so there currently is approx. 10K of
surplus code into the module).
I'm listing below the name of the object files that are *a surplus*
(not required by the COM32 module itself, but included explicitly by
me in the module binary). I'm asking your opinion (in particular, hpa)
about what are the object files that you don't consider a basic
service and don't need to be present in the root module. If you
consider 25K an acceptable size for the root module, those objects, of
course, don't need to be removed.
LIBENTRY_OBJS = \
sys/farcall.o sys/cfarcall.o sys/zeroregs.o \
sys/argv.o \
sys/ftell.o \
sys/isatty.o sys/fstat.o
LIBGCC_OBJS = \
libgcc/__ashldi3.o \
libgcc/__negdi2.o libgcc/__ashrdi3.o libgcc/__lshrdi3.o \
libgcc/__muldi3.o \
libgcc/__divdi3.o libgcc/__moddi3.o
LIBCONSOLE_OBJS = \
sys/colortable.o sys/screensize.o \
\
sys/rawcon_write.o \
sys/null_read.o sys/null_write.o sys/serial_write.o \
\
sys/xserial_write.o \
\
sys/ansi.o \
\
sys/ansicon_write.o sys/ansiserial_write.o \
\
syslinux/serial.o
LIBOTHER_OBJS = \
abort.o atexit.o atoi.o atol.o atoll.o calloc.o creat.o \
ctypes.o \
putchar.o setjmp.o \
fread2.o fwrite2.o getopt.o \
lrand48.o memccpy.o memchr.o memcmp.o \
memcpy.o mempcpy.o memmem.o memmove.o memset.o memswap.o \
exit.o onexit.o \
perror.o qsort.o realloc.o seed48.o snprintf.o \
sprintf.o srand48.o sscanf.o strcasecmp.o \
strdup.o strerror.o strlen.o \
strnlen.o \
strncasecmp.o strncat.o strncmp.o strndup.o \
stpcpy.o stpncpy.o \
strntoimax.o strntoumax.o strrchr.o strstr.o \
strtoimax.o strtol.o strtoll.o strtoul.o strtoull.o \
strtoumax.o vprintf.o vsprintf.o \
asprintf.o vasprintf.o strlcat.o \
vsscanf.o zalloc.o \
\
sys/x86_init_fpu.o math/pow.o math/strtod.o
Thank you!
Stefan Bucur