Differences in GCC and ICC compiled objects, GCC relocations broken?

2012-02-23 Thread J K
 Posted in the Intel forums but this may be more of a GCC issue.
 Please advise if I should post elsewhere.

 Compiling a C module in with a large app (>2GB data) and getting
relocatable errors with GCC and
 not ICC.

./classification_dpr_BB.o: In function `BB_detection_dpr':
/homedata/johnk/dpr/src_
20120126/DD2_V2.20120126/src/./
classification_dpr_BB.c:118: relocation truncated to fit:
R_X86_64_PC32 against `.bss'

 Can anyone familiar with the output of readelf see why the GCC
 object is not relocatable and the ICC one is? Would another tool
 be more suitable?

icc -I../include -g -v -sox -fPIC -mcmodel=medium -DDEBUG  -c
./classification_dpr_BB.c
cc -I../include -g -v -fPIC -mcmodel=medium -DDEBUG  -c
./classification_dpr_BB.c

  This module does not use more than 2GB data itself, I just need it
to be linked with
  code that does, so -fPIC.  I left off the medium memory model switch
on both with no impact.
  Everything is static except for the -shared-intel -mcmodel=medium
on the main link (ifort is used).

  Could it have something to do with the relocation types? Are there
switches to GCC to force relocations
  like ICC?

GCC
Relocation section '.rela.text' at offset 0xd040 contains 449 entries:
 Offset          Info           Type           Sym. Value    Sym.
Name + Addend
004e  00170002 R_X86_64_PC32      .rodata
+ fffc
008e  00040002 R_X86_64_PC32      .bss +
1e5c
00bc  00040002 R_X86_64_PC32      .bss +
105c


ICC
Relocation section '.rela.text' at offset 0xf222 contains 732 entries:
 Offset          Info           Type           Sym. Value    Sym.
Name + Addend
0030  0078001a R_X86_64_GOTPC32  
_GLOBAL_OFFSET_TABLE_ + fffc
0036  00060019 R_X86_64_GOTOFF64 
_2il0floatpacket.15 + 0
0057  00070019 R_X86_64_GOTOFF64 0008
_2il0floatpacket.16 + 0
009f  0078001a R_X86_64_GOTPC32  
_GLOBAL_OFFSET_TABLE_ + fffc

gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51)
icc (ICC) 11.1 20100806

 The full output of readelf -all are at these links.

ICC
http://www.box.com/s/2iqnqydmi0mdz52xs9ac

GCC
http://www.box.com/s/jjcgq1x2s5ybpg7s9b6g

Thanks for any help.


Fwd: Differences in GCC and ICC compiled objects, GCC relocations broken?

2012-03-06 Thread J K
 Yes,
  I replicated this on an Ubuntu 11 distro with GCC 4.6.x


On Thu, Feb 23, 2012 at 5:34 PM, Iyer, Balaji V  wrote:
> Hello J. K.,
>        Have you tried with a newer version of GCC? GCC 4.1 is pretty old
>
> Thanks,
>
> Balaji V. Iyer.
>
> -Original Message-
> From: J K [mailto:jkwi...@gmail.com]
> Sent: Thursday, February 23, 2012 10:31 AM
> To: gcc@gcc.gnu.org
> Subject: Differences in GCC and ICC compiled objects, GCC relocations broken?
>
>  Posted in the Intel forums but this may be more of a GCC issue.
>  Please advise if I should post elsewhere.
>
>  Compiling a C module in with a large app (>2GB data) and getting relocatable 
> errors with GCC and  not ICC.
>
> ./classification_dpr_BB.o: In function `BB_detection_dpr':
> /homedata/johnk/dpr/src_
> 20120126/DD2_V2.20120126/src/./
> classification_dpr_BB.c:118: relocation truncated to fit:
> R_X86_64_PC32 against `.bss'
>
>  Can anyone familiar with the output of readelf see why the GCC
>  object is not relocatable and the ICC one is? Would another tool
>  be more suitable?
>
> icc -I../include -g -v -sox -fPIC -mcmodel=medium -DDEBUG  -c 
> ./classification_dpr_BB.c cc -I../include -g -v -fPIC -mcmodel=medium -DDEBUG 
>  -c ./classification_dpr_BB.c
>
>   This module does not use more than 2GB data itself, I just need it to be 
> linked with
>   code that does, so -fPIC.  I left off the medium memory model switch on 
> both with no impact.
>   Everything is static except for the -shared-intel -mcmodel=medium on the 
> main link (ifort is used).
>
>   Could it have something to do with the relocation types? Are there switches 
> to GCC to force relocations
>  like ICC?
>
> GCC
> Relocation section '.rela.text' at offset 0xd040 contains 449 entries:
>  Offset          Info           Type           Sym. Value    Sym.
> Name + Addend
> 004e  00170002 R_X86_64_PC32      .rodata
> + fffc
> 008e  00040002 R_X86_64_PC32      .bss + 1e5c 
> 00bc  00040002 R_X86_64_PC32      .bss + 105c
>
>
> ICC
> Relocation section '.rela.text' at offset 0xf222 contains 732 entries:
>  Offset          Info           Type           Sym. Value    Sym.
> Name + Addend
> 0030  0078001a R_X86_64_GOTPC32   
> _GLOBAL_OFFSET_TABLE_ + fffc
> 0036  00060019 R_X86_64_GOTOFF64 
> _2il0floatpacket.15 + 0
> 0057  00070019 R_X86_64_GOTOFF64 0008
> _2il0floatpacket.16 + 0
> 009f  0078001a R_X86_64_GOTPC32   
> _GLOBAL_OFFSET_TABLE_ + fffc
>
> gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-51) icc (ICC) 11.1 20100806
>
>  The full output of readelf -all are at these links.
>
> ICC
> http://www.box.com/s/2iqnqydmi0mdz52xs9ac
>
> GCC
> http://www.box.com/s/jjcgq1x2s5ybpg7s9b6g
>
> Thanks for any help.