[klibc] shared klibc patch

H. Peter Anvin hpa@zytor.com
Thu, 22 Aug 2002 01:20:04 -0700

Here is the patch for a shared-but-not-dynamic version of klibc.  I 
don't want to check it in just yet because it will break all non-i386 
architectures.  However, I will probably check it in later this week.

There are three architecture-specific things to worry about:

a) The definition of crt0.S has changed.  After learning more about ELF 
and, specifically, how Linux implements ELF, I have decided that the 
original definition of crt0.S didn't make sense; it would have had to 
change anyway to support the shared code.  The new version should be 
significantly simpler -- all it needs to do is pass a pointer to the ELF 
data structure and the "atexit" pointer (usually left in a register) 
using the C calling convention.

b) A load address for the library has to be chosen.  This may mean 
taking into account what kind of call instructions are used between 
normal modules.

c) Make sure interp.S can assemble.  It should be completely generic, as 
it's all data, but there could potentially be an assembly syntax issue.