Operating System - HP-UX
1753767 Members
5902 Online
108799 Solutions
New Discussion юеВ

/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 3
Dennis Handly
Acclaimed Contributor

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 !!
Dennis Handly
Acclaimed Contributor

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?