Re: Announce: initrd-tftp 0.1

From: Avery Pennarun (apenwarr@worldvisions.ca)
Date: Sun Jan 09 2000 - 16:42:46 EST


On Sun, Jan 09, 2000 at 08:18:13PM +0000, Philip Blundell wrote:

> >Even if you don't want them, you end up linking in malloc, stdio, and other
> >large chunks of useless stuff because the init/shutdown code (crt*.o) needs
> >to initialize these subsystems. Some clever changes to libc would
> >dramatically improve this situation, but it would take some work. Someday,
> >perhaps I'll have a chance...
>
> You can make things quite a lot better by including these lines in your
> program:
>
> exit() { }
> abort() { }
> atexit() { }
> void *__libc_stack_end;
>
> The latter is really a granularity problem with libc but the first three
> are probably to be expected. There's no easy way to avoid that excess
> code being linked in without imposing additional runtime overhead.

Hmm, thanks -- I hadn't thought of doing that.

Of course, calling printf makes it big again, but that's no real surprise
(and it's still not as big as before). I'm pleased to see that write(),
for example, doesn't increase the size much at all.

It seems prudent to call _exit() in exit() and abort() rather than do
absolutely nothing, though; this avoids a segfault at shutdown if you
actually do any work in main().

Have fun,

Avery

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jan 15 2000 - 21:00:15 EST