[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building sharable object libraries for CALL_EXTERNAL



In article <36EAAE98.8F975873@fajnm1.am.ub.es>,
Octavi Fors  <octavi@fajnm1.am.ub.es> wrote:
>
>I tried your advice with -G flag:
>
>$ld -o routine.so -z text -G routine.o
>Text relocation remains                       referenced
>    against symbol                  offset      in file
><unknown>                           0x1c        routine.o
><unknown>                           0x20        routine.o
>.mul                                0xb0        routine.o
>.mul                                0x120       routine.o
>mcount                              0x28        routine.o
>ld: fatal: relocations remain against allocatable but non-writable sections

Hmmmm.  I just tried your routine with gcc, (we don't have Sun's compilers)
% uname -a
SunOS sagan 5.6 Generic_105181-09 sun4u sparc SUNW,Ultra-5_10
% gcc -fPIC -c routine.c
% /usr/ucb/ld -o t1.so -z text -G routine.o

Under gcc, -fPIC and -fpic generate different code.  Could that be the 
problem?

Eric
-- 
Eric Korpela                        |  An object at rest can never be
korpela@ssl.berkeley.edu            |  stopped.
<a href="http://sag-www.ssl.berkeley.edu/~korpela";>Click for home page.</a>