PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

Which Env. will trigger R_X86_64_PC32 relocation issue

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Jerryleo



Joined: 22 Aug 2005
Posts: 36

PostPosted: Fri Mar 14, 2014 7:30 am    Post subject: Which Env. will trigger R_X86_64_PC32 relocation issue Reply with quote

With PGI 11.8 and later, it's still suffering the 'overflow in R_X86_64_PC32 relocation' issue on certain 64-bit Linux box if without spcifying -fPIC/mcmodel=medium for compile and link, but there is completely no this sort of issue on certain 64-bit Linux box even if without specifying -fPIC/mcmodel=medium for link and compile

I know this issue can be fixed by using -fPIC/mcmodel=medium, but tired always need to add/remove them by manual.

Just wondering

1. Which sort of Env. will trigger R_X86_64_PC32 relocation issue?

2. How to force to link with 64-bit offset based on the references instead 32-bit by default without using -fPIC/mcmodel=medium?

3. Or how to change the system Env. settings to avoid R_X86_64_PC32 relocation issue?


Thanks

Jerry
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6146
Location: The Portland Group Inc.

PostPosted: Fri Mar 14, 2014 8:58 am    Post subject: Reply with quote

Hi Jerry,

By default, Linux uses the small memory model. This means that the static offset between the executable code and all the data in the data section is accessible within 32-bits.

Hence, you have one of two options:

Use -fpic/-mcmodel=medium so the base offset to the data is re-locatable.
or
Use less static data, typically by changing static arrays to be dynamically allocated.


Why this would occur on some Linux systems but not others, I'm not sure. I would guess however, that your static data is large but different assemblers and linkers will put in different static data and those difference could put you over the 32-bit offset. Another possibility is which libraries are being linked and if they are being linked statically or dynamically.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group