Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28603 Discussions

gprel relocation against dynamic symbol ERROR

j_elston
Beginner
962 Views
Ok, to start with I must say that I have RTFM and google'd and I'm still no wiser.

I have software I compile on both itaniums and pc's with the intel C and Fortran compilers

My problem is with compiling a dynamic library on an itanium ( on a i686 this works) using the latest v8 compiler. "intel-ifort8-8.0-57.ia64 .rpm"

I have a library consisting of mainly fortran objects and one c object -> all compiled with intel compilers with the -fpic options set.

but at the linking stage all I get either a :
a) "ld: cfile.o: @gprel relocation against dynamic symbol c_variable" ERROR
b) the linker pauses indefinitely ( until I kill it > 1 hour )

I have tried various options such as using either ifort or ld as the linker and also passing the options -i_dynamic and -nofor_main. I always pass the option -shared.

but no luck with these incantations.

I passed the -v option to the linker (ifort) and the following is the result ( have removed some o files for clarity.)

ld /usr/lib/crti.o /home/me/opt/intel_fc_80/lib/crtxi.o -shared --version-script /home/me/opt/intel_fc_80/lib/icrt.internal.map -o libmine.so -relax addme.o edgend4.o -Qy -L/home/me/opt/intel_fc_80/lib -L/usr/lib -lifport -lifcoremt -ldl -limf -lm -lcxa -lunwind -u __pthread_once -lpthread -lirc -lc -lirc /home/me/opt/intel_fc_80/lib/crtxn.o /usr/lib/crtn.o
ld: edgend4.o: @gprel relocation against dynamic symbol Rnd64_fact

"Rnd64_fact" is a variable declared in my c file.

any ideas ?

J
0 Kudos
6 Replies
Steven_L_Intel1
Employee
962 Views
I believe that the following is in the release notes:

gprel relocation Error Messages on Itanium-based Linux Systems

On Itanium-based systems running Linux, when the -shared switch is used to create a Dynamic Shared Object (.so), there may be some "relocation against dynamic symbol" messages generated during the ld phase, similar to:

/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__segv_default_msg
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_fpe_mask
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_undcnt
...

To fix this problem, add the switches -i_dynamic and -nofor_main to the command line.

0 Kudos
j_elston
Beginner
962 Views
Steve , in effect you told me to RTFM, 3/4 of the way down original my posting, I stated that I had used the options -i_dynamic and -nofor_main

they didn't help.
0 Kudos
Steven_L_Intel1
Employee
962 Views
Sorry, I missed that. I suggest sending an example to Premier Support.
0 Kudos
j_elston
Beginner
962 Views
Ok, will do,

Thanks anyway Steve, sorry I was a bit short earlier - late nights & these problems don't mix :/
0 Kudos
svanve
Beginner
962 Views
I believe that the following is in the release notes:

gprel relocation Error Messages on Itanium-based Linux Systems

On Itanium-based systems running Linux, when the -shared switch is used to create a Dynamic Shared Object (.so), there may be some "relocation against dynamic symbol" messages generated during the ld phase, similar to:

/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__segv_default_msg
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_fpe_mask
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_undcnt
...

To fix this problem, add the switches -i_dynamic and -nofor_main to the command line.

0 Kudos
svanve
Beginner
962 Views
I believe that the following is in the release notes:

gprel relocation Error Messages on Itanium-based Linux Systems

On Itanium-based systems running Linux, when the -shared switch is used to create a Dynamic Shared Object (.so), there may be some "relocation against dynamic symbol" messages generated during the ld phase, similar to:

/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__segv_default_msg
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_fpe_mask
/usr/bin/ld: for_init.o: @gprel relocation against dynamic symbol for__l_undcnt
...

To fix this problem, add the switches -i_dynamic and -nofor_main to the command line.

if you are using intel fortran comiler "ifort" then this switch i.e. -i_dynamic and -nofor_main will work and if you are using gcc compiler then you should use -fPIC switch whilecompiling for object file .o file and then go forshared object file.so file.

thanks....

0 Kudos
Reply