This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction


Jay K <jay.krell@cornell.edu> writes:

> I haven't tried 4.5.0 yet.

You should, all those bugs should be fixed in 4.5.0, but not all of the
fixes have been backported to the 4.4 branch yet.

> -bash-4.1$ /opt/csw/gcc4/bin/g++ -v
> Using built-in specs.
> Target: i386-pc-solaris2.10
> Configured with: ../gcc-4.3.3/configure --prefix=/opt/csw/gcc4 --exec-prefix=/op
> t/csw/gcc4 --with-gnu-as --with-as=/opt/csw/bin/gas --without-gnu-ld --with-ld=/
> usr/ccs/bin/ld --enable-nls --with-included-gettext --with-libiconv-prefix=/opt/
> csw --with-x --with-mpfr=/opt/csw --with-gmp=/opt/csw --enable-java-awt=xlib --e
> nable-libada --enable-libssp --enable-objc-gc --enable-threads=posix --enable-st
> age1-languages=c --enable-languages=ada,c,c++,fortran,java,objc
> Thread model: posix
> gcc version 4.3.3 (GCC)

This version is ancient history, I don't even test it anymore: mainline + 4.4
and 4.5 branches is more than enough.

> /opt/csw/gcc4/bin/g++ 1.cpp -fPIC -S -m64
>         "1.s", line 117 : Warning: Illegal subtraction - symbols from different sections: ".LFB2", ".DOT-2"
>         "1.s", line 120 : Warning: Illegal subtraction - symbols from different sections: ".LLSDA2", ".DOT-3"
> void F1();
> void F2()
> {
>   try { F1(); } catch(...) {F2(); }
> }
>
>  
>  /usr/ccs/bin/as -xarch=amd64 1.s

There's something wrong here: while the gcc above is configured to use
gas, those warnings are from Sun as.  You cannot expect to assemble
compiler output for one assembler with another one.  There is a common
subset, but syntax or capabilties are different in some cases.

> or similar:
> -bash-4.1$ cat 2.c
> void F1() { }
>  
>
>    /opt/csw/gcc4/bin/gcc -fPIC -S -funwind-tables -m64 2.c
>    /usr/ccs/bin/as -xarch=amd64 2.s
> Assembler: 2.c
>         "2.s", line 38 : Warning: Illegal subtraction - symbols from different sections: ".LFB2", ".DOT-1"

Driver error: don't do this.

> I'm aware of this thread:
> http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00908.html

This has been fixed since

2009-01-29  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config/i386/sol2-10.h [!HAVE_AS_IX86_DIFF_SECT_DELTA]
	(ASM_OUTPUT_DWARF_PCREL): Define.

> I think I'll switch to GNU as, or omit -funwind-tables for now.
>   Or see if 4.5.0 fixes it.
> Sparc32, sparc64, x86 work.

Please have a look the relevant sections of Installing GCC to find out
about tools requirements.

> -gstabs+ also generated .stabd that Sun assembler didn't like.

Shouldn't happen anymore since

2010-02-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/i386/sol2.h (NO_DBX_BNSYM_ENSYM): Define.
	* config/i386/sol2-gas.h: New file.
	* config.gcc (i[34567]86-*-solaris2*): Use it.

> I switched to -gstabs.
> Maybe I messed up something though, as it looks like gcc is aware not to output .stabd to non-gas.
>   More reason to use GNU assembler, understood.

Not necessarily, see above for current recommendations.

> http://gcc.gnu.org/install/specific.html#ix86-x-solaris210
>  could be a bit more precise:
>   >> Recent versions of the Sun assembler in /usr/ccs/bin/as work almost as well, though. 
>
>  
> "almost as well"?
> Maybe that should say more, like, use -g or -gstabs instead of -gstabs+, don't use 64bit+pic+unwind-tables or 64bit+pic+exceptions

No, all those issues are fixed at least in mainline and 4.5.  And the
installation instructions on gcc.gnu.org are from mainline, so might be
newer than the latest released version.

> I switched to Sun assembler because I'm seeing GNU as installed in different places on different machines.
>   Some people don't install /usr/sfw and the install elsewhere.

If you build gcc yourself, either stay with Sun as (as you can) or
install GNU as from recent binutils.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]