HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

/usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position

 
liuyongxyz
Occasional Advisor

/usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position

I am having a problem linking a module compiled with gcc 4.2.3
I get the following message from ld when it goes to link the modules into a shared module, even though gcc ran with the -fpic (position independant code flag):

/usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position
independent. Use +z or +Z to recompile.
collect2: ld returned 1 exit status
*** Error exit code 1

Stop.

HELP!!!
3 REPLIES

Re: /usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position

The error means what it says. Remove ccCTeej6.o and recompile it with -fpic.
liuyongxyz
Occasional Advisor

Re: /usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position


But there is no ccCTeej6.o under /tmp !

I ran with the -fpic or -fPIC, but the problem still !!

Re: /usr/ccs/bin/ld: DP relative code in file /tmp/ccCTeej6.o - shared library must be position

You may need to add -v to see where that file is coming from.
What to you have on your gcc compile and link lines?