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

Re: Building sharable object libraries for CALL_EXTERNAL

"Eric J. Korpela" wrote:
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

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>


Talking with my system manager, he told me that the right compilation option is SunSolaris instead SusOs (in IDL Users Guide 4.0 they are considered separately). In that way, I proceed with the SunSolaris options, described in the IDL Users Guide:

$ uname -a
SunOS mizar 5.5.1 Generic_103640-05 sun4u sparc SUNW,Ultra-Enterprise

$ cc -G -Kpic -c routine.c
$ ld -G -o routine.so routine.o

and no problem!

Thanks all!


Octavi Fors Aldrich

Departament d'Astronomia i Meteorologia
Facultat de Fisica
Avgda. Diagonal 647
08028 Barcelona

Telf: 34-934021122
Fax:  34-934021133
e-mail: octavi@fajnm1.am.ub.es