According to ELF format (http://www.lnxscene.org/jylam/elf2.ps), there
is a special section called '.init'. This section can contain code which
will be launched immediadly after the shared library will be loaded by
ld.so .

If you try to do this in assembly and think it'll be easy, be prepared
to have some problems. In fact, the problem is that ld (the linker) will
add some more code in this section, then put your own, and will fuck up
the stack, then will lose the start entry address.
That's why it's easier to put that in a C file, sometimes it's good to
let the C compiler do the bad stuff :)
Happy hacking.

--
Jean-Yves Lamoureux

The zip file viewer built into the Developer Toolbox made use
of the zlib library, as well as the zlibdll source additions.