[uClibc] RE: [uClibc-cvs] svn commit: trunk/uClibc/ldso/ldso:armcris i386 m68k mips powerpc sh sh64 etc...

Peter Kjellerstedt peter.kjellerstedt at axis.com
Tue Mar 15 15:40:30 UTC 2005


> -----Original Message-----
> From: Joakim Tjernlund [mailto:joakim.tjernlund at lumentis.se] 
> Sent: Tuesday, March 15, 2005 16:14
> To: Peter Kjellerstedt
> Cc: uclibc at uclibc.org
> Subject: RE: [uClibc] RE: [uClibc-cvs] svn commit: 
> trunk/uClibc/ldso/ldso:armcris i386 m68k mips powerpc sh sh64 etc...
> 
> > > > -----Original Message-----
> > > > From: uclibc-bounces at uclibc.org 
> > > > [mailto:uclibc-bounces at uclibc.org] On Behalf Of Joakim Tjernlund
> > > > Sent: Tuesday, March 15, 2005 09:41
> > > > To: uclibc at uclibc.org
> > > > Subject: [uClibc] RE: [uClibc-cvs] svn commit: 
> > > > trunk/uClibc/ldso/ldso: armcris i386 m68k mips powerpc sh sh64
etc...
> > > > 
> > > > > On Mon Mar 14, 2005 at 06:25:10AM -0700, jocke at uclibc.org
wrote:
> > > > > > I probably broke one or two archs(only tested PPC) so please
> > > > > > try and report problems. For a report to be useful you need
> > > > > > to enable __SUPPORT_LD_DEBUG_EARLY__ and 
> > > > > > __SUPPORT_LD_DEBUG__
> > > > > 
> > > > > I can confirm that at least mips and x86 are broken...
> > > > [SNIP]
> > > > 
> > > > x86, MIPS and PPC should be OK now. No reports on the other
> > > > arches CRIS, ARM, SPARC, M68K, SH and SH64 (Hint hint :)
> > > 
> > > I have made CRIS compile agin (r10007). I have, however, no 
> > > idea if the change is actually correct, since it seems that
> > > elf_machine_load_address() is never called (I tried changing
> > > it to return 0x12345678 and everything still worked)...
> > 
> > Good, but I think your change is wrong. The
elf_machine_load_address() 
> > will be called when you execute ldso directly(/lib/ld-uClibc.so.0). 
> > This is a preparation for beeing able to do "/lib/ld-uClibc.so.0 
> > /bin/ls". Just try running /lib/ld-uClibc.so.0 with 
> > __SUPPORT_LD_DEBUG_EARLY__ enabled. You should end up with:
> > "Cool, we managed to make a function call."
> > before is SEGVs.
> > 
> > I think you should add back _dl_boot in elf_machine_load_address()
but 
> > you probably need to define "extern void _dl_boot(void)" somewhere
in 
> > dl-sysdep.h. I tried to add a "extern void _dl_boot(void)" into
ldso.c, 
> > but it turns out that _dl_boot differs between archs.
> 
> I think something like this is needed:
> OK, to commit?

Does not work for CRIS at least. After applying the patch I 
get the following when I build (which btw was the same that 
I got before my failed attempt to fix it earlier):

make -C ldso
make[2]: Entering directory
`/home/pkj/241Q-new_uClibc/libs/uClibc/ldso/ldso'
ccache cris-gcc  -Wall -Wstrict-prototypes -Wno-trigraphs
-fno-strict-aliasing   -Os     -mlinux -fpic
-DUCLIBC_RUNTIME_PREFIX=\"/\" -fno-builtin -nostdinc -D_LIBC
-I../../ldso/include -I. -I../../include -isystem
/usr/local/cris/lib/gcc-lib/cris-axis-elf/3.2.1/include
-D__SUPPORT_LD_DEBUG__ -D__SUPPORT_LD_DEBUG_EARLY__ -I../libdl -c ldso.c
-o ldso.o
cris-ld -mcrislinux -z now -Bsymbolic -shared --warn-common
--export-dynamic --sort-common -z combreloc --discard-locals
--discard-all --no-undefined -e _dl_boot -soname=ld-uClibc.so.0 \
        -o ld-uClibc-0.9.27.so cris/resolve.o ldso.o
/usr/local/cris/lib/gcc-lib/cris-axis-linux-gnu/3.2.1/libgcc.a
cris-ld: ldso.o: relocation R_CRIS_32_GOTREL is not allowed for global
symbol: `_dl_boot' from .text section
cris-ld: final link failed: Bad value
make[2]: *** [ld-uClibc-0.9.27.so] Error 1
make[2]: Leaving directory
`/home/pkj/241Q-new_uClibc/libs/uClibc/ldso/ldso'

//Peter



More information about the uClibc mailing list