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

Re: call_external: ld.so.1 relocation error



Martin Rother wrote:
> 
>     hi wizards!
> 
>          I used 'call_external' very exceptionally yet. now I run into a
>          'relocation error' while executing 'call_external' -- with a very
>          simple test-application too. the IDL 'call_external' demo is still
>          running, but as my fortran-code is calling 'atan' (or other
>          trig.-functions.), the 'ld.so.1' fails to resolve the symbol.
>     'make' is designed to call:
> 
> /opt/zrt_opt/SUNWspro/bin/f77 -pic -G test.f -o test.so -lF77 -lm -lc -lM77
>    test.f:
>         test:
>         test_slave:
> 
>     and 'ldd' on 'test.so' seems to be fine:
> 
>         libF77.so.4 =>   /opt/zrt_opt/SUNWspro/lib/libF77.so.4
>         libm.so.1 =>     /opt/zrt_opt/SUNWspro/lib/libm.so.1
>         libc.so.1 =>     /usr/lib/libc.so.1
>         libM77.so.2 =>   /opt/zrt_opt/SUNWspro/lib/libM77.so.2
>         libdl.so.1 =>    /usr/lib/libdl.so.1
>         /usr/platform/SUNW,Ultra-60/lib/libc_psr.so.1

That's telling you it can find the libraries you have requested, it
isn't
telling you which externals remain unresolved.

> 
>    but my 'test.pro' crashes IDL with:
> 
>         IDL >>  test
>    ld.so.1: /opt/rsi/idl_5.4/bin/bin.solaris2.sparc/idl: \
>         fatal: relocation error: \
>         file /home/mt/rother/prj/champ/Lib/ME/6/test.so: \
>         symbol __atanf: referenced symbol not found
> 
>            Killed
> 
>    (but 'atan' seems to be in 'libM77.so.2'!)
> 

It is actaully undefined in libM77.so :

$ nm libM77.so | grep atan
[428]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atan
[379]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atan2
[491]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atan2f
[493]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atan2l
[353]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atanf
[354]   |         0|       0|FUNC |GLOB |0    |UNDEF  |__atanl


On my system the function which is undefined in your DSO (__atanf) 
is defined in libsunmath.so. Try adding -lsunmath to the end of your 
list of libraries.


-- 
-----------------------------------------------------------
Nigel Wade, System Administrator, Space Plasma Physics Group,
            University of Leicester, Leicester, LE1 7RH, UK 
E-mail :    nmw@ion.le.ac.uk 
Phone :     +44 (0)116 2523568, Fax : +44 (0)116 2523555