[Bug ld/2607] linker doesn't recognize an ELF library.

2006-05-09 Thread scp at predict dot com


-- 
   What|Removed |Added

 CC||scp at predict dot com


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

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-09 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-09 19:47 
---
Created an attachment (id=1015)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1015&action=view)
libbug.so.ld from previous example


-- 


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

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-09 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-09 19:45 
---
Created an attachment (id=1013)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1013&action=view)
libbug.so.cc from example in previous comment


-- 


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

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-09 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-09 19:39 
---

I have just run into what I believe is the same problem. It appears to be due to
a new version of the Sun ld (/usr/ccs/bin/ld) which was installed recently on
our Solaris8 systems as part of trying to patch up the Sun ONE Studio 8 and Sun
Studio 10 compiler suites. Sun's ld will happily recognize the shared objects
produced by the new ld, but binutil 2.16 (and 2.16.1)'s bfd library will not.

Further investigation showed that the shared library in question was the only
one in our codebase with this problem, and it happens to be the only shared
library in our codebase in which the source files (i.e. *.o object files going
in) were compiled with the Sun C compiler), but the shared library was created
using the Sun C++ driver (i.e. CC -G ...). Furthermore, the problem occurs
because /usr/ccs/bin/ld is invoked with the option
-zld32=-S/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1, which
contains exception handling support. Invoking the equivalent /usr/ccs/bin/ld
command minus that command line option, the resulting library is handled without
problem by binutils.

The workaround for us has been to create the shared library using cc -G instead
of CC -G in the case where there are no C++ sources in the shared library.

I should emphasize that /usr/ccs/bin/ld is perfectly happy with the resulting
shared objects no matter how they were created.

Here's a few more details:

% ls -l /usr/ccs/bin/ld
-rwxr-xr-x  1 root bin 7824 Oct 27  2005 /usr/ccs/bin/ld*
% cksum /usr/ccs/bin/ld
3259439703 7824 /usr/ccs/bin/ld

% ls -l /usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1
-rwxrwxr-x  1 root sys 12320 Mar 13  2003
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1*
% cksum /usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1
4099598650 12320 /usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1

And an example which will reproduce the problem (assuming you have the right
versions of Sun stuff...)

First create a simple object for a shared lib:

% cat bug.c
int foo()
{
   return 1;
}
% cc -KPIC -c bug.c

Make a shared library using the cc driver

% cc -# -G -o libbug.so.cc bug.o
### Note: NLSPATH =
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
### command line files and options (expanded):
### -G bug.o -o libbug.so.cc
### Note: LD_LIBRARY_PATH = /home/scp/lib
### Note: LD_RUN_PATH = 
/usr/ccs/bin/ld /usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/crti.o
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/values-xa.o -o libbug.so.cc -G
bug.o -Y
"P,/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib:/usr/ccs/lib:/usr/lib" -Qy
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/crtn.o

Check and see that binutils likes the file

% /usr/local/pkg/binutils-2.16.1/bin/nm libbug.so.cc
000102e8 b Bbss.bss
...


Now do the same using the CC (C++) driver. First a dryrun to see the ld command,
and then the real command.

% CC -dryrun -G -o libbug.so.CC bug.o
### command line files and options (expanded):
### -dryrun -G -o libbug.so.CC bug.o -xcode=pic13 
### CC: Note: NLSPATH =
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/../lib/locale/%L/LC_MESSAGES/%N.cat:/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/../../lib/locale/%L/LC_MESSAGES/%N.cat
### CC: Note: LD_LIBRARY_PATH = /home/scp/lib
### CC: Note: LD_RUN_PATH = (null)
### CC: Note: LD_OPTIONS = (null)
/usr/ccs/bin/ld
-zld32=-S/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libCCexcept.so.1
-zld64=-S/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/v9/libCCexcept.so.1
-zld32=-S/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/libldstab_ws.so
-zld64=-S/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/v9/libldstab_ws.so -dy
-G
-R/usr/local/pkg/SunONEStudio8/SUNWspro/lib/rw7:/usr/local/pkg/SunONEStudio8/SUNWspro/lib:/opt/SUNWspro/lib:/usr/ccs/lib:/usr/lib
-o libbug.so.CC /usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/crti.o
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/CCrti.o bug.o -Y
P,/usr/local/pkg/SunONEStudio8/SUNWspro/lib/rw7:/usr/local/pkg/SunONEStudio8/SUNWspro/lib:/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/rw7:/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib:/usr/ccs/lib:/usr/lib
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/CCrtn.o
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/lib/crtn.o >&/tmp/ld.24218.0.err
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/c++filt -filt=no%stdlib
>/tmp/c++filt.24218.1.err
rm /tmp/ld.24218.0.err
/usr/local/pkg/SunONEStudio8/SUNWspro/prod/bin/stdlibfilt -stderr
http://sourceware.org/bugzilla/show_bug.cgi?id=2607

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-09 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-09 19:46 
---
Created an attachment (id=1014)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=1014&action=view)
libbug.so.CC from previous example


-- 


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

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-10 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-10 22:26 
---
Nick,

That patch, applied against the 2.16.1 release source (with a little syntactic
fudge by hand on the last hunk) seems to do the trick perfectly.

Thank you!

(I'll leave it to you or others to change the status of the this bug.

-- 


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

--- 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/2607] linker doesn't recognize an ELF library.

2006-05-10 Thread scp at predict dot com

--- Additional Comments From scp at predict dot com  2006-05-10 22:27 
---
Uh, duh, I should point out that it solves my problem. I cannot speak for 
Pawel...

-- 


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

--- 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