[Bug ld/1150] undefined reference to `_mpi_sgi_init'

2005-11-10 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2005-11-10 11:45 
---
Subject: Re:  undefined reference to `_mpi_sgi_init'

Hi Michael,

> Okay, I gave it a try to build a testcase. It's included in the attachment.

Thanks.  I was not able to run all of the tests in your testcase, since 
I do not have the Irix system libraries available, but I was able to 
reproduce the linker error message about undefined symbols and I have 
produced a tentative patch that might allow give you a working GNU linker.

The patch does not implement all of the spec for OPTIONAL symbols.  I 
hope that for now this will not be important.

The patch also includes a modification to readelf so that it will 
display the OPTIONAL flag if it is defined in an Irix binary.  You do 
not actually need this part of the patch in order to get a working 
linker, but I have included it since it is all part of the same problem.

Cheers
   Nick



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1150

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


Re: [Bug ld/1150] undefined reference to `_mpi_sgi_init'

2005-11-10 Thread Nick Clifton

Hi Michael,


Okay, I gave it a try to build a testcase. It's included in the attachment.


Thanks.  I was not able to run all of the tests in your testcase, since 
I do not have the Irix system libraries available, but I was able to 
reproduce the linker error message about undefined symbols and I have 
produced a tentative patch that might allow give you a working GNU linker.


The patch does not implement all of the spec for OPTIONAL symbols.  I 
hope that for now this will not be important.


The patch also includes a modification to readelf so that it will 
display the OPTIONAL flag if it is defined in an Irix binary.  You do 
not actually need this part of the patch in order to get a working 
linker, but I have included it since it is all part of the same problem.


Cheers
  Nick



___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/1150] undefined reference to `_mpi_sgi_init'

2005-11-10 Thread nickc at redhat dot com

--- Additional Comments From nickc at redhat dot com  2005-11-10 12:51 
---
Created an attachment (id=754)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=754&action=view)
Second attempt to handle OPTIONAL symbols


-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1150

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug ld/1150] undefined reference to `_mpi_sgi_init'

2005-11-10 Thread michael at weiser dot dinsnail dot net

--- Additional Comments From michael at weiser dot dinsnail dot net  
2005-11-10 18:57 ---
The testcase nwo runs fine with the patched ld:

[EMAIL PROTECTED] ot]$ make bu
as -64 -o start.o start.s
as -64 -o ot.o ot.s
as -64 -o os.o os.s
/usr/local/bin/ld -melf64bmip -o ot-opt-bu /usr/lib64/mips4/crt1.o ot.o
os.o /usr/lib64/mips4/crtn.o -lc
/usr/local/bin/ld -melf64bmip -o ot-noopt-bu /usr/lib64/mips4/crt1.o
ot.o /usr/lib64/mips4/crtn.o -lc
sed -e "s,/\* \(.weak.*\) \*/,\1," ot.s >otw.s
as -64 -o otw.o otw.s
/usr/local/bin/ld -melf64bmip -o otw-opt-bu /usr/lib64/mips4/crt1.o
otw.o os.o /usr/lib64/mips4/crtn.o -lc
/usr/local/bin/ld -melf64bmip -o otw-noopt-bu /usr/lib64/mips4/crt1.o
otw.o /usr/lib64/mips4/crtn.o -lc
[ -x ot-opt-bu ] && ./ot-opt-bu
*** Error code 73 (bu21) (ignored)
[ -x ot-noopt-bu ] && ./ot-noopt-bu
*** Error code 255 (bu21) (ignored)
[ -x otw-opt-bu ] && ./otw-opt-bu
*** Error code 73 (bu21) (ignored)
[ -x otw-noopt-bu ] && ./otw-noopt-bu
*** Error code 255 (bu21) (ignored)

Even the not-present-detection seems to work somehow (!?). Ahh, that may be
because the optional symbols are actually resolved to __missing_function_ by
*rld* not ld.

But the original problem with libpthread remains:

[EMAIL PROTECTED] ~]$ cat t.c
int main(void) {
}
[EMAIL PROTECTED] ~]$ gcc -o  t.o -c t.c
[EMAIL PROTECTED] ~]$ gcc -o t t.o -lpthread
/usr/lib/../lib64/libpthread.so: undefined reference to `_mpi_sgi_init'
collect2: ld returned 1 exit status

The actual ld call is as follows:

/usr/local/bin/ld -v -call_shared -init __gcc_init -fini __gcc_fini -melf64bmip
-o t /usr/lib64/mips3/crt1.o
/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/64/irix-crti.o
/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/64/crtbegin.o
-L/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/64
-L/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1
-L/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/../../../../lib64
-L/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/../../.. -L/lib/../lib64
-L/usr/lib/../lib64 t.o -lpthread -lgcc -L/usr/lib64/mips3 -L/usr/lib64 -lc
-lgcc /usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/64/crtend.o
/usr/local/gcc-4.0.1/lib/gcc/mips-sgi-irix6.5/4.0.1/64/irix-crtn.o
/usr/lib64/mips3/crtn.o

Is there a difference in treatment of object and *shared* object symbols?

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=1150

--- You are receiving this mail because: ---
You are on the CC list for the bug, or are watching someone who is.


___
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils