Segfault of executables with shared libraries.

Colin Whittaker colinw at occamnetworks.com
Thu Feb 26 19:45:45 UTC 2009


Hi, I'm new here. I searched and found a similar thread that didn't seem 
to get resolved. Any help would be grand.. :-)

I'm trying to build a cross tool chain for mips using buildroot.
uClibc 0.9.29
gcc 4.2.3
binutils 2.18
Kernel headers 2.6.21.5

Everything builds fine and my target system builds just fine.
Kernel builds and runs just fine. Only problem:
All the executables that load shared libraries segfault immediately.
This was most difficult to find since init(busybox) was segfaulting, but 
it shows nothing. Once I built it with -static it runs.
I'm guessing this is a problem with ld-uClibc-0.9.29...

I have a previous version built by someone else that functions on our 
target, but it has no debugging symbols.
uClibc 0.9.27
gcc 3.4.2
binutils 2.15
Kernel 2.6.21.5
I saw some post about gcc 4.3 and glibc 2.4 not being compatible and 
causing a similar problem. But of course there was no detail of the 
problem. just a version change appeared to fix it. And it doesn't apply 
to uClibc. Or does it ?

One interesting thing I see is the apps built with the new tools all 
have a extra program header, all NULL.
mips-linux-objdump -x shows:
architecture: mips:isa32, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x00420b80

Program Header:
    PHDR off    0x00000034 vaddr 0x00400034 paddr 0x00400034 align 2**2
         filesz 0x00000100 memsz 0x00000100 flags r-x
  INTERP off    0x00000134 vaddr 0x00400134 paddr 0x00400134 align 2**0
         filesz 0x00000014 memsz 0x00000014 flags r--
0x70000000 off    0x00000148 vaddr 0x00400148 paddr 0x00400148 align 2**2
         filesz 0x00000018 memsz 0x00000018 flags r--
    LOAD off    0x00000000 vaddr 0x00400000 paddr 0x00400000 align 2**16
         filesz 0x0013c12c memsz 0x0013c12c flags r-x
    LOAD off    0x0013c12c vaddr 0x0054c12c paddr 0x0054c12c align 2**16
         filesz 0x00009df0 memsz 0x00128ea8 flags rw-
 DYNAMIC off    0x00000160 vaddr 0x00400160 paddr 0x00400160 align 2**2
         filesz 0x00000100 memsz 0x00000100 flags rwx
EH_FRAME off    0x0013c110 vaddr 0x0053c110 paddr 0x0053c110 align 2**2
         filesz 0x0000001c memsz 0x0000001c flags r--
    NULL off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags ---

Is that suppose to be there ?

Thanks for any help...

Colin..



More information about the uClibc mailing list