# HELP! /lib/libpthread.so.0 invalid elf header

## mast3rmind

I can use "ls" anymore  every time i try to use ls i get 

```

ls: error while loading shared libraries /lib/libpthread.so.0: invalid elf header

```

So non of my scripts can run at boot, and i can view any files. 

Some one please help me threw this problem.

----------

## Steven Robertson

You, my friend, are quite thoroughly screwed.  Your system is basically trashed, until you can restore the file.

But there's hope!  If you can, using the LiveCD, send me the details of your CHOST, CFLAGS, and glibc version, I can build you a binary package of glibc.  Just untar it (again, using the livecd) in your hard drive's root, and you _should_ get your system usable again.  Immediately remerge glibc from sources afterwards.

PM me if that would help.

Steve

----------

## mast3rmind

how could have happend the system was just installed this morning?

I using kernel 2.6.7 and i recompiled it earlier today to get pegasus usb support and after that it was fine, then later i get this . . .

----------

## Steven Robertson

Either filesystem corruption, or an incomplete/improper merge caused by too aggressive CFLAGS or a damaged GCC, or possibly even memory corruption.  

To test for filesystem corruption, find the MD5sum of several CDs or other large files on a different disc, copy them over to your hard drive, and see if the MD5sums match.  To test for memory corruption, use the mentest86plus tool available at http://www.memtest.org/.  Overly aggressive CFLAGS should be obvious, and a damaged GCC will be shown by it being unable to compile itself (meaning you can't emerge gcc); you'd have to pull a binary package if that's the case.

Try the memory.  I got burned bad with bad RAM once.  If you do find it to be bad, check out a kernel with the new badram patch floating around.  (I use Nitro-Sources, and it incorporates the patch.)  That will enable you to have a perfectly stable system, despite any bad sections of your RAM.

----------

## mast3rmind

this machine doesnt have a cdrom drive because it's a sony picturebook c1x (sony didnt sell them with pcmcia cdroms) but i managed to come up with a way to install  linux over the windows 98 (that came stock on it) I installed mandrake linux 8.2 3 months ago using a usb cdrom and the mandrake 8.2 usb boot floppy, mandrake seemed to run fine and all, despite the fact some things where slow (it was big n slow mandrake! ) and X ran fine, but yesterday i decide  to install gentoo, so from in side the mandrake installation, i using mutilple xterm windows, i use an empty partion for gentoo  and use the stage2 tarball. after the install it ran fine, so i deleted the mandrake partions  and made a larger partion for gentoo's /usr and i then ran "cp -a /usr/* /usr2" and in a ssh session, logged into the laptop, i ran "ls /usr2" and thats when i got this error.  

I don't think it's bad memory,  and the CFLAGS where the default settings, the only thing i think  it could be is filesystem corruption.  since me usb ethernet device is down i can d/l any files.

btw:

My cflags and  chost set  by the catalyst build script are 

```

CFLAGS="-02 -mcpu=i686 -fomit-frame-pointer"

CHOST="i386-pc-linux-gnu"

```

----------

## Steven Robertson

I take it back, it prolly wasn't hardware.  See this thread:

https://forums.gentoo.org/viewtopic.php?t=208838

Guy had your exact problem.

----------

