[uClibc]Re: building uclibc and busybox

David Schleef ds at schleef.org
Sat Sep 15 02:09:59 UTC 2001


On Fri, Sep 14, 2001 at 01:53:42PM -0600, Erik Andersen wrote:
> On Fri Sep 14, 2001 at 12:45:54PM -0700, David Schleef wrote:
> > On Thu, Sep 13, 2001 at 03:45:07PM -0600, Erik Andersen wrote:
> > > 
> > > I have not tried shared libs on powerpc for a while.  Let me go try
> > > it on a Debian box.
> > > 
> > > <sound of Erik trying uClibc on ppc>
> > > 
> > > It looks like uClibc's shared lib loader is not currently working
> > > on powerpc.
> > 
> > Because I never finished it.  I use the glibc ld.so.  Given that
> > I am also no longer employed by Lineo, I don't have much incentive
> > to finish it, although I'll probably do it anyway.
> 
> Do you remember what parts you left unfinished?  Knowing that would
> help whenever someone finds the time to work on it,


With the following patch, ld-uClibc will mostly work on powerpc on
very simple binaries.  For whatever reason, the removed code
causes a GOT lookup, which fails because the GOT isn't set up
yet.  After fixing this, you get tons of debugging information
about symbol fixups and such, and it will inevitably fail with
a reloc that it can't handle.  To get it completely working
just requires adding code to handle the rest of the reloc types,
specifically R_PPC_COPY.

I'll try to finish this sometime soon, since it's one of those
cases where it would take less time to do it than to explain
how to do it.



dave...


Index: boot1.c
===================================================================
RCS file: /var/cvs/uClibc/ldso/d-link/boot1.c,v
retrieving revision 1.23
diff -u -r1.23 boot1.c
--- boot1.c	2001/08/11 00:18:04	1.23
+++ boot1.c	2001/09/15 01:55:53
@@ -220,8 +220,12 @@
 
 	/* Check the ELF header to make sure everything looks ok.  */
 	if (! header || header->e_ident[EI_CLASS] != ELFCLASS32 ||
-		header->e_ident[EI_VERSION] != EV_CURRENT || 
-		_dl_strncmp((void *)header, ELFMAGIC, SELFMAG) != 0)
+		header->e_ident[EI_VERSION] != EV_CURRENT
+#if 0
+		|| 
+		_dl_strncmp((void *)header, ELFMAGIC, SELFMAG) != 0
+#endif
+		)
 	{
 	    SEND_STDERR("Invalid ELF header\n");
 	    _dl_exit(0);







More information about the uClibc mailing list