[uClibc] was initfini, crt[in].S changes and ET_DYN

Peter S. Mazinger ps.m at gmx.net
Mon Nov 10 14:12:17 UTC 2003


On Sun, 9 Nov 2003 pageexec at freemail.hu wrote:

> > > the problem i found is that it assumes that the virtual addresses in
> > > the ELF header of the main executable will be the runtime load
> > > addresses. this is a wrong assumption, and it breaks badly for ET_DYN
> > > executables since they're linked at a base of 0 but loaded elsewhere
> > > (under PaX that would even be a random address). the fix is of course
> > > to learn the runtime load address and make use of it instead of the
> > > one in the ELF header.
> 
> ok, i ported the patch to 0.9.22 and managed to compile a working
> ET_DYN executable. what i did is a very rude/quick fix for getting
> it to work, there are code paths that i didn't touch (but should
> be still fixed) nor is my method the best way to do it, i'll leave
> doing this properly up to you now.

Thanks for it.

I have checked the earlier attached patch, it works ok for uClibc-0.9.22 
and works both instead of crt0.S and crt1.S (depending on the 
build-defines -DL_crt). It is binary compatible with uClibc-0.9.22 (tested 
on i386), so my question to the developers:
What do you need to apply the ldso.c patch to cvs? I would supply also the 
crt[01]S.S file with changes to the Makefile, so it also creates crt0S.o 
and crt1S.o.
If you are not willing to apply it, would it make any difference, if it 
would become a separate build-option? The changes would make uClibc's 
loader glibc-compliant and would provide the needed files to build ET_DYN 
binaries (see the explanation of the changes above). Probably it will also 
be necessary to support the new binutils' -pie option.

Peter

-- 
Peter S. Mazinger <ps.m at gmx.net>   ID: 0xA5F059F2    NIC: IXUYHSKQLI
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2


____________________________________________________________________
Miert fizetsz az internetert? Korlatlan, ingyenes internet hozzaferes a FreeStarttol.
Probald ki most! http://www.freestart.hu



More information about the uClibc mailing list