Linux-kernel mailing list archive 2000-02,: Re: Announce: initrd-tftp 0.1

# Re: Announce: initrd-tftp 0.1

Avery Pennarun (apenwarr@worldvisions.ca)
Sun, 9 Jan 2000 16:42:46 -0500

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Andre Hedrick: "ALI M15x3 chipset support (EXPERIMENTAL) Migration..."
- Previous message: =?iso-8859-1?Q?D=E8nis_Riedijk?=: "bug: kernel timer added twice at c8032807"

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/

- Next message: Andre Hedrick: "ALI M15x3 chipset support (EXPERIMENTAL) Migration..."
- Previous message: =?iso-8859-1?Q?D=E8nis_Riedijk?=: "bug: kernel timer added twice at c8032807"