Problems linking shared library

I'm encountering the following warnings when linking a shared library:

....

CC -I. -c -DUNIX -KPIC WM_numeric.cxx

ld -z verbose -G -o libeqpr.so distribution.o lognormal.o standardnormal.o MurexAPIEntryPoint.o CibcModelAPI.o WM_EqModelBase.o WM_EqModelTree.o WM_EqModelVarSwap.o WM_numeric.o

ld: warning: relocation warning: R_SPARC_DISP32: file distribution.o: symbol <unknown>: displacement relocation applied to the symbol __1cMCIBC_PRICINGbL__RTTI__1nMCIBC_PRICINGMDistribution__: at 0x50: displacement relocation will not be visible in output image

ld: warning: relocation warning: R_SPARC_DISP32: file distribution.o: symbol <unknown>: displacement relocation applied to the symbol __1cMCIBC_PRICINGbL__RTTI__1nMCIBC_PRICINGMDistribution__: at 0x58: displacement relocation will not be visible in output image

ld: warning: relocation warning: R_SPARC_DISP32: file distribution.o: symbol <unknown>: displacement relocation applied to the symbol __1cMCIBC_PRICINGbN__RTTI__1CpnMCIBC_PRICINGMDistribution__: at 0x90: displacement relocation will not be visible in output image

....

The warning seem to be related to the fact that I use virtual members in classes that are derived and the member overriden. (I'm saying that because I have a similar library with no virual members and I don't get the warnings even if I use the same options).

uname -a:

SunOS cbsccuseqt1d 5.9 Generic_118558-17 sun4u sparc SUNW,Sun-Fire-880

CC -V:

CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-22 2005/04/29

Please advise

[1614 byte] By [oulisee] at [2007-11-26 10:25:36]
# 1

More info: hopefully I get an opinion:)

The header file:

#ifndef DISTRIBUTION_H

#define DISTRIBUTION_H

class Distribution

{

public:

virtual double marketVol( double _x) const;

};

#endif

The cpp file:

#include "distribution.h"

double Distribution::marketVol( double _x) const

{

return 1.0;

}

Makefile:

LIB = libeqpr.so

CC=CC

CFLAGS = -I. -c -DUNIX -KPIC

LDFLAGS = -z verbose -G

LINK_LIBPATH =

LINK_LIBS=

OBJS = distribution.o

all: ${LIB}

libeqpr.so: ${OBJS}

ld ${LDFLAGS} -o ${LIB} ${OBJS}

distribution.o: distribution.cpp

$(CC) $(CFLAGS) distribution.cpp

clean:

-rm libeqpr.so *.o

Message was edited by:

oulisee

oulisee at 2007-7-7 2:28:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 2

The short answer is that you can ignore these warnings. You only see these warnings with the "-z verbose" option.

The longer answer is that the compiler should not be generating code that causes these warnings. We are looking into how to fix the compiler.

Message was edited by:

clamage45

clamage45 at 2007-7-7 2:28:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...
# 3
I've had the problem analyzed, and filed a bug report: 6476787
clamage45 at 2007-7-7 2:28:27 > top of Java-index,Development Tools,Solaris and Linux Development Tools...