This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

Relocations and linking GCC vs Intel C objects


Posted in the Intel forums but this may be more of a GCC/ld 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. Output of readelf on the .o
is below. Relocation types are different.

./classification_dpr_BB.o: In function `BB_detection_dpr':
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
00000000004e ?001700000002 R_X86_64_PC32 ? ? 0000000000000000 .rodata
+ fffffffffffffffc
00000000008e ?000400000002 R_X86_64_PC32 ? ? 0000000000000000 .bss +
1e5c
0000000000bc ?000400000002 R_X86_64_PC32 ? ? 0000000000000000 .bss +
105c


ICC
Relocation section '.rela.text' at offset 0xf222 contains 732 entries:
?Offset ? ? ? ? ?Info ? ? ? ? ? Type ? ? ? ? ? Sym. Value ? ?Sym.
Name + Addend
000000000030 ?00780000001a R_X86_64_GOTPC32 ?0000000000000000
_GLOBAL_OFFSET_TABLE_ + fffffffffffffffc
000000000036 ?000600000019 R_X86_64_GOTOFF64 0000000000000000
_2il0floatpacket.15 + 0
000000000057 ?000700000019 R_X86_64_GOTOFF64 0000000000000008
_2il0floatpacket.16 + 0
00000000009f ?00780000001a R_X86_64_GOTPC32 ?0000000000000000
_GLOBAL_OFFSET_TABLE_ + fffffffffffffffc

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.


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