public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
@ 2010-05-10  0:42 Jay K
  2010-05-10  0:48 ` Andrew Pinski
  2010-06-07 23:59 ` Rainer Orth
  0 siblings, 2 replies; 7+ messages in thread
From: Jay K @ 2010-05-10  0:42 UTC (permalink / raw)
  To: gcc


I haven't tried 4.5.0 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)
 

/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
 


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"
 

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

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.
 
 
-gstabs+ also generated .stabd that Sun assembler didn't like.
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.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  0:42 pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction Jay K
@ 2010-05-10  0:48 ` Andrew Pinski
  2010-05-10  1:02   ` Jay K
                     ` (2 more replies)
  2010-06-07 23:59 ` Rainer Orth
  1 sibling, 3 replies; 7+ messages in thread
From: Andrew Pinski @ 2010-05-10  0:48 UTC (permalink / raw)
  To: Jay K; +Cc: gcc



Sent from my iPhone

On May 9, 2010, at 5:42 PM, Jay K <jay.krell@cornell.edu> wrote:

>
> I haven't tried 4.5.0 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


You configured gcc to build with the gnu as but then run with it so  
what do you expect.


> --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)
>
>
> /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
>
>
>
> 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"
>
>
> I'm aware of this thread:
> http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00908.html
>
>
>
> 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.
>
>
> -gstabs+ also generated .stabd that Sun assembler didn't like.
> 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.
>
>
> 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
>
>
> 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.
>
>
> - Jay

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  0:48 ` Andrew Pinski
@ 2010-05-10  1:02   ` Jay K
  2010-05-10  3:17   ` Jay K
  2010-05-10  7:42   ` Jay K
  2 siblings, 0 replies; 7+ messages in thread
From: Jay K @ 2010-05-10  1:02 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc


Ah, good point. I don't think my "real" scenario did that though.
I'll investigate more. Networking problems were?are hampering download 4.5.0 and
 build and configure it.
 
I did come up with Makefile:
 
Assemble = $(shell if test -x /opt/csw/gnu/as ; then echo /opt/csw/gnu/as ; \
     elif test -x /usr/sfw/bin/gas ; then echo /usr/sfw/bin/gas ; \
     else echo "unable to find GNU assembler" ; fi )
 
:) which addresses why I wasn't using GNU as.
 
(Yes, I've heard of autoconf.)
 
Thanks, later,
 - Jay


----------------------------------------
> From: pinskia@gmail.com
> To: jay.krell@cornell.edu
> Subject: Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
> Date: Sun, 9 May 2010 17:48:04 -0700
> CC: gcc@gcc.gnu.org
>
>
>
> Sent from my iPhone
>
> On May 9, 2010, at 5:42 PM, Jay K wrote:
>
>>
>> I haven't tried 4.5.0 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
>
>
> You configured gcc to build with the gnu as but then run with it so
> what do you expect.
>
>
>> --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)
>>
>>
>> /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
>>
>>
>>
>> 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"
>>
>>
>> I'm aware of this thread:
>> http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00908.html
>>
>>
>>
>> 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.
>>
>>
>> -gstabs+ also generated .stabd that Sun assembler didn't like.
>> 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.
>>
>>
>> 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
>>
>>
>> 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.
>>
>>
>> - Jay 		 	   		  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  0:48 ` Andrew Pinski
  2010-05-10  1:02   ` Jay K
@ 2010-05-10  3:17   ` Jay K
  2010-05-10  7:42   ` Jay K
  2 siblings, 0 replies; 7+ messages in thread
From: Jay K @ 2010-05-10  3:17 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc


Fix in 4.4.0.
 
I was getting:
 
.LASFDE1:
.long   .LASFDE1-.Lframe1
.long   .LFB2-.              <<<
.long   .LFE2-.LFB2
 
4.5.0 configured right:
 
.LASFDE1:
        .long   .LASFDE1-.Lframe1
        .long   .LFB0@rel     <<< 
        .long   .LFE0-.LFB0
 
dw2_asm_output_encoded_addr_rtx =>
 
#ifdef ASM_OUTPUT_DWARF_PCREL
   ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
#else
   dw2_assemble_integer (size, gen_rtx_MINUS (Pmode, addr, pc_rtx));
#endif

 <no other hits> 
 C:\src\gcc-4.4.0\gcc\config\i386\sol2-10.h(45):#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
 C:\src\gcc-4.5.0\gcc\config\i386\sol2-10.h(46):#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \

 
#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
  do {       \
    fputs (integer_asm_op (SIZE, FALSE), FILE);  \
    assemble_name (FILE, LABEL);   \
    fputs (SIZE == 8 ? "@rel64" : "@rel", FILE); \
  } while (0)
#endif

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.

http://gcc.gnu.org/viewcvs?view=revision&revision=143758
 
 
Thanks,
 - Jay


----------------------------------------
> From: jay.krell@cornell.edu
> To: pinskia@gmail.com
> CC: gcc@gcc.gnu.org
> Subject: RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
> Date: Mon, 10 May 2010 01:02:29 +0000
>
>
> Ah, good point. I don't think my "real" scenario did that though.
> I'll investigate more. Networking problems were?are hampering download 4.5.0 and
> build and configure it.
>
> I did come up with Makefile:
>
> Assemble = $(shell if test -x /opt/csw/gnu/as ; then echo /opt/csw/gnu/as ; \
> elif test -x /usr/sfw/bin/gas ; then echo /usr/sfw/bin/gas ; \
> else echo "unable to find GNU assembler" ; fi )
>
> :) which addresses why I wasn't using GNU as.
>
> (Yes, I've heard of autoconf.)
>
> Thanks, later,
> - Jay
>
>
> ----------------------------------------
>> From: pinskia@gmail.com
>> To: jay.krell@cornell.edu
>> Subject: Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
>> Date: Sun, 9 May 2010 17:48:04 -0700
>> CC: gcc@gcc.gnu.org
>>
>>
>>
>> Sent from my iPhone
>>
>> On May 9, 2010, at 5:42 PM, Jay K wrote:
>>
>>>
>>> I haven't tried 4.5.0 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
>>
>>
>> You configured gcc to build with the gnu as but then run with it so
>> what do you expect.
>>
>>
>>> --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)
>>>
>>>
>>> /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
>>>
>>>
>>>
>>> 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"
>>>
>>>
>>> I'm aware of this thread:
>>> http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00908.html
>>>
>>>
>>>
>>> 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.
>>>
>>>
>>> -gstabs+ also generated .stabd that Sun assembler didn't like.
>>> 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.
>>>
>>>
>>> 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
>>>
>>>
>>> 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.
>>>
>>>
>>> - Jay 		 	   		  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  0:48 ` Andrew Pinski
  2010-05-10  1:02   ` Jay K
  2010-05-10  3:17   ` Jay K
@ 2010-05-10  7:42   ` Jay K
  2010-05-10  9:12     ` Marc Glisse
  2 siblings, 1 reply; 7+ messages in thread
From: Jay K @ 2010-05-10  7:42 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc


It might also be necessary to configure for i586-sun-solaris2.10 instead of i586-solaris2.10.
Something I read said you can use various shorter forms, and I like the idea for convenience and to avoid those "pc"s and "unknown"s,
but this seems to have bitten me a number of times, not just today.

Anyway, it is working for me, configure -without-gnu-as i586-sun-solaris2.10, having applied Rainer's change to a 4.3 tree.
 (Yes, I'd like to upgrade.)

It seems using GNU as might still be slightly preferred in order to move data (jump tables) out of .text and into read only data, like, you know, "the less that is executable, the more secure". Though for locality, .text might be better.

For now I'm erring toward using what is more often present in the same location.

I should have just waited till I tested with 4.5, that would have shut me up. :)

Thanks,
 - Jay

----------------------------------------
> From: jay.krell@cornell.edu
> To: pinskia@gmail.com
> CC: gcc@gcc.gnu.org
> Subject: RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
> Date: Mon, 10 May 2010 03:17:40 +0000
>
>
> Fix in 4.4.0.
>
> I was getting:
>
> .LASFDE1:
> .long .LASFDE1-.Lframe1
> .long .LFB2-. <<<
> .long .LFE2-.LFB2
>
> 4.5.0 configured right:
>
> .LASFDE1:
> .long .LASFDE1-.Lframe1
> .long .LFB0@rel <<<
> .long .LFE0-.LFB0
>
> dw2_asm_output_encoded_addr_rtx =>
>
> #ifdef ASM_OUTPUT_DWARF_PCREL
> ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, XSTR (addr, 0));
> #else
> dw2_assemble_integer (size, gen_rtx_MINUS (Pmode, addr, pc_rtx));
> #endif
>
> 
> C:\src\gcc-4.4.0\gcc\config\i386\sol2-10.h(45):#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
> C:\src\gcc-4.5.0\gcc\config\i386\sol2-10.h(46):#define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
>
>
> #define ASM_OUTPUT_DWARF_PCREL(FILE, SIZE, LABEL) \
> do { \
> fputs (integer_asm_op (SIZE, FALSE), FILE); \
> assemble_name (FILE, LABEL); \
> fputs (SIZE == 8 ? "@rel64" : "@rel", FILE); \
> } while (0)
> #endif
>
> 2009-01-29 Rainer Orth 
> * config/i386/sol2-10.h [!HAVE_AS_IX86_DIFF_SECT_DELTA]
> (ASM_OUTPUT_DWARF_PCREL): Define.
>
> http://gcc.gnu.org/viewcvs?view=revision&revision=143758
>
>
> Thanks,
> - Jay
>
>
> ----------------------------------------
>> From: jay.krell@cornell.edu
>> To: pinskia@gmail.com
>> CC: gcc@gcc.gnu.org
>> Subject: RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
>> Date: Mon, 10 May 2010 01:02:29 +0000
>>
>>
>> Ah, good point. I don't think my "real" scenario did that though.
>> I'll investigate more. Networking problems were?are hampering download 4.5.0 and
>> build and configure it.
>>
>> I did come up with Makefile:
>>
>> Assemble = $(shell if test -x /opt/csw/gnu/as ; then echo /opt/csw/gnu/as ; \
>> elif test -x /usr/sfw/bin/gas ; then echo /usr/sfw/bin/gas ; \
>> else echo "unable to find GNU assembler" ; fi )
>>
>> :) which addresses why I wasn't using GNU as.
>>
>> (Yes, I've heard of autoconf.)
>>
>> Thanks, later,
>> - Jay
>>
>>
>> ----------------------------------------
>>> From: pinskia@gmail.com
>>> To: jay.krell@cornell.edu
>>> Subject: Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
>>> Date: Sun, 9 May 2010 17:48:04 -0700
>>> CC: gcc@gcc.gnu.org
>>>
>>>
>>>
>>> Sent from my iPhone
>>>
>>> On May 9, 2010, at 5:42 PM, Jay K wrote:
>>>
>>>>
>>>> I haven't tried 4.5.0 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
>>>
>>>
>>> You configured gcc to build with the gnu as but then run with it so
>>> what do you expect.
>>>
>>>
>>>> --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)
>>>>
>>>>
>>>> /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
>>>>
>>>>
>>>>
>>>> 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"
>>>>
>>>>
>>>> I'm aware of this thread:
>>>> http://gcc.gnu.org/ml/gcc-patches/2006-07/msg00908.html
>>>>
>>>>
>>>>
>>>> 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.
>>>>
>>>>
>>>> -gstabs+ also generated .stabd that Sun assembler didn't like.
>>>> 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.
>>>>
>>>>
>>>> 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
>>>>
>>>>
>>>> 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.
>>>>
>>>>
>>>> - Jay
 		 	   		  

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  7:42   ` Jay K
@ 2010-05-10  9:12     ` Marc Glisse
  0 siblings, 0 replies; 7+ messages in thread
From: Marc Glisse @ 2010-05-10  9:12 UTC (permalink / raw)
  To: Jay K; +Cc: gcc

On Mon, 10 May 2010, Jay K wrote:

> It seems using GNU as might still be slightly preferred in order to move 
> data (jump tables) out of .text and into read only data, like, you know, 
> "the less that is executable, the more secure". Though for locality, 
> .text might be better.

Note that you can also try to ping Oracle with this pointer:
http://bugs.sun.com/view_bug.do?bug_id=6832717

-- 
Marc Glisse

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction
  2010-05-10  0:42 pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction Jay K
  2010-05-10  0:48 ` Andrew Pinski
@ 2010-06-07 23:59 ` Rainer Orth
  1 sibling, 0 replies; 7+ messages in thread
From: Rainer Orth @ 2010-06-07 23:59 UTC (permalink / raw)
  To: Jay K; +Cc: gcc

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-06-07 22:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-10  0:42 pic+64bit+sun assembler+unwind-tables => illegal cross section subtraction Jay K
2010-05-10  0:48 ` Andrew Pinski
2010-05-10  1:02   ` Jay K
2010-05-10  3:17   ` Jay K
2010-05-10  7:42   ` Jay K
2010-05-10  9:12     ` Marc Glisse
2010-06-07 23:59 ` Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).