Solaris 8: ld produces malformed symbol table / omniORB does not compile with gcc using binutils ld

andreas@florath.net andreas@florath.net
Fri Apr 11 11:04:00 GMT 2003


Hello!

	I have some problems with gcc using binutils ld under Solaris 8.
It looks that the written file is (a little bit) corrupted.

> gcc -v
Reading specs from
/opt/gcc322-32/lib/gcc-lib/sparc-sun-solaris2.8/3.2.2/specs
Configured with: ../gcc-3.2.2/configure --prefix=/opt/gcc322-32
--enable-shared --enable-threads --with-cpu=v9 --with-gnu-as
--with-as=/opt/gcc322-32/bin/as --with-gnu-ld
--with-ld=/opt/gcc322-32/bin/ld --disable-multilib
Thread model: posix
gcc version 3.2.2
> which ld
/opt/gcc322-32/bin/ld
> ld --version
GNU ld version 2.13.2.1
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms
of
the GNU General Public License.  This program has absolutely no
warranty.
> 
> cat hw.c 
#include <stdio.h>

int main(void)
{
        printf("Hello, World!\n");
        return 0;
}

> gcc -o hw hw.c 
> ./hw 
Hello, World!
> pvs -ls hw
        libc.so.1 (SYSVABI_1.3);
/usr/bin/sparcv9/pvs: warning: hw: unable to deduce reduced symbols:
        malformed symbol table[1]=.symtab: does not equal STT_FILE


If I compile this with gcc that does not use the binutils ld,
everything is fine:

> gcc -v
Reading specs from
/opt/gcc321/bin/../lib/gcc-lib/sparc-sun-solaris2.8/3.2.1/specs
Configured with: ../gcc-3.2.1/configure
--prefix=/opt/gcc321/pkg/gcc-3.2.1 --enable-threads
--with-as=/opt/gcc321/bin/as --with-gnu-as
Thread model: posix
gcc version 3.2.1
> 
> gcc -o hw hw.c
> ./hw
Hello, World!
> pvs -ls hw
        libc.so.1 (SYSVABI_1.3);
> 


        I found this problem, because omniORB does not compile when
using a gcc which ld:

(The error was 'ld.so.1: /opt/gcc322-32/bin/python: fatal: relocation
error: file /opt/gcc322-32/tmp/omniORB-4.0.0/lib/_omniidlmodule.so:
symbol PyFile_Type: referenced symbol not found')

where ld.so.1 looks for the symbol 'PyFile_Type' in the python
executable, but does not find it (although nm reports that the symbol
is there:

> /usr/ccs/bin/nm /opt/gcc322-32/bin/python | fgrep PyFile_Type
[3143]  |    941412|     188|OBJT |GLOB |0    |13     |PyFile_Type
> nm /opt/gcc322-32/bin/python | fgrep PyFile_Type
000e5d64 D PyFile_Type



        Best Regards

        Andreas Florath



More information about the Binutils mailing list