Return to Ferret FAQ


Solaris 2.4: relocation error: symbol not found: rindex:


Question:


I have some difficulties using the new version 4.9 on a Solaris 2.4 System.
At execution, I have this message :

        NOAA/PMEL TMAP
 Program FERRET (GUI)
 Version 4.90 - 11/19/97
 26-Nov-97 11:11
ld.so.1: ferret: fatal: relocation error: symbol not found: rindex:
referenced in ferret
Killed

Solution:

The solution to this problem (which has only been reported to be a problem under Solaris 2.4) comes thanks to Thierry Ludjet, who experienced it initially:
Date: Tue, 16 Dec 1997 13:28:45 +0100
From: Thierry Ludjet 

Here is my own solution:

cat <<\EOF >rindex.c
#include 
char *rindex(const char *s, const char c)
{
    return strrchr(s, c);
}
EOF

gcc -fpcc-struct-return -fpic -c rindex.c
ld -o libindex.so.1 -G -z text -h libindex.so rindex.o

cp libindex.so.1 /usr/local/libindex.so.1
chmod 644 /usr/local/libindex.so.1
ln -s /usr/local/libindex.so.1 /usr/local/libindex.so
export LD_PRELOAD=/usr/local/libindex.so #(ksh syntax)


Contributed Thierry Ludjet of Meteo France, 26 Nov 1997
Last modified: Mon Oct 27 16:02:27 PST 2003