[Top] [All Lists]

Seg fault when compiled with -mabi=64 and -lpthread

To: "'Linux/MIPS Development'" <>
Subject: Seg fault when compiled with -mabi=64 and -lpthread
From: "Bryan Althouse" <>
Date: Thu, 30 Jun 2005 13:33:39 -0400
Original-recipient: rfc822;
Thread-index: AcV9mdoBnM33Jz9ERSG+iD9SiRy2CQ==

I have a problem when linking a 64 bit application with libpthread.  I appears to link fine, but it will seg fault when I execute it.  I wrote an empty C program called empty.c:


int main (void)

    return 0;



I cross compile it with:

/opt/redhat/mips64linux-031001/H-i686-pc-linux-gnulibc2.2/bin/mips64-linux-gnu-gcc –mabi=64 empty.c –o empty –lpthread

The executable will seg fault.  If I remove the –lpthread, it is fine.  Also, if I change the 64 to 32, it is fine.


Maybe I have a bad libpthread in /lib64?  If I type “file /lib64/” I get: “ELF 64-bit MSB shared object, mips-3 MIPS R3000_BE, version 1, not stripped”.  Looks fine to me.  Should I cross compile and replace libpthread?  If so, where can I find the source?


The other strange thing is that ldd does not work on 64 bit applications.  It will always return:  “not a dynamic executable”.  Does anyone know how this could be fixed? 


I’m using a PMC Yosemite board with an RM9224 processor.  The kernel is 2.6.12 64bit SMP.  I am using the PMC supplied cross compile tools, kernel, and NFS file system.


Thanks for your help!




<Prev in Thread] Current Thread [Next in Thread>