comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Building sharable object libraries for CALL_EXTERNAL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Building sharable object libraries for CALL_EXTERNAL [message #14670 is a reply to message #14591] Sat, 13 March 1999 00:00 Go to previous messageGo to previous message
Octavi Fors is currently offline  Octavi Fors
Messages: 13
Registered: March 1999
Junior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
"Eric J. Korpela" wrote:
<blockquote TYPE=CITE>In article &lt;36E9649A.7F5C8B65@fajnm1.am.ub.es>,
<br>Octavi Fors&nbsp; &lt;octavi@fajnm1.am.ub.es> wrote:
<br>>
<br>>Hello,
<br>>
<br>>This is my first trial calling a C-routine from IDL with CALL_EXTERNAL,
<br>>and I have some problems with building routine.so file. It's just
a
<br>>test, so the routine it's very simple:
<br>>
<br>>Second, when I try to create routine.so with:
<br>>$ ld -o routine.so -z text routine.o (changing '-assert pure-text'
to
<br>>'-z text' because it's a SunOS Version 5.5.1)
<p>I think you need to specify the -G flag to ld when creating a shared
<br>object file under Solaris.</blockquote>
I tried your advice with -G flag:
<p><font size=-1>$ld -o routine.so -z text -G routine.o<br>
Text relocation remains&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&am p;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
referenced<br>
&nbsp;&nbsp;&nbsp; against symbol&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
offset&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in file<br>
&lt;unknown> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp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bsp;& ;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
0x28&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp; routine.o<br>
ld: fatal: relocations remain against allocatable but non-writable sections</font><br>
<BR>
<br>but it also seems to fail. The error message seems to indicate some
problem with
<br>relocations. What do you think?
<br>Taking a look at the routine.c code (it's in the first message), I
noticed that the
<br>**pointer (output) I'm passing back to IDL is malloced in the C-routine,
in line:
<p><font size=-1>output=(float **)malloc(4*n);</font>
<br><font size=-1>&nbsp;for(i=0;i&lt;n;i++) output[i]=(float*)malloc(4*x*y);</font><font size=-1></font>
<p>Is there something wrong with this?
<br>I tried not to malloc output inside routine.c (commenting previous
lines), but last
<br>error messages still remains.
<p>Any ideas are welcome.
<p>Octavi.
<p>--&nbsp;<br>
============================================================ ===== <br>
<br>
Octavi Fors Aldrich<br>
<br>
Astronomy Department
<br>Physics Faculty
<br>Avgda. Diagonal 647<br>
08028 Barcelona<br>
SPAIN<br>
<br>
Telf: 34-934021122<br>
Fax:&nbsp; 34-934021133<br>
e-mail: octavi@fajnm1.am.ub.es<br>
<br>
============================================================ =====
<br>&nbsp;</html>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Writing on X without X device (!)
Next Topic: Re: Colour maps ... (BYTE_SCALE)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 14:56:05 PDT 2025

Total time taken to generate the page: 0.08543 seconds