[Top][All Lists]

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

Re: [Bug ld/4266] New: hidden alias not found while linking gcj compiled

From: Nick Clifton
Subject: Re: [Bug ld/4266] New: hidden alias not found while linking gcj compiled Java class with native C++ lib and CNI binding under Linux x86
Date: Fri, 23 Mar 2007 10:29:08 +0000
User-agent: Thunderbird (X11/20061215)

Hi Andreas,

Well I can shed some light on how this problem is happening, although not necessarily why:

de/dbt/simplelibclient/SimpleCPPLib.o:(.data.rel+0x68): undefined reference to
`hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)'

Looking at libSimpleCPPLib.so, where you would expect to find the definition of the alias shows:

  % nm -C SimpleCPPLib/Debug/libSimpleCPPLib.so | grep square
0000071c t hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)
  0000071c T de::dbt::simplelibclient::SimpleCPPLib::square(int)

The "t" is critical. It indicates that the hidden alias is local to the file and not visible outside the library. Hence you are getting the link-time error. Looking at the SimpleCPPLib.o file on its own, (ie not inside the library) shows:

  % nm -C SimpleCPPLib/Debug/SimpleCPPLib.o | grep square
00000000 T hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)
  00000000 T de::dbt::simplelibclient::SimpleCPPLib::square(int)

ie here the hidden alias is type "T", an exported text symbol. This explains why you can link directly against the SimpleCPPLib.o file and obtain a fully resolved executable.

I am not an expert on java, but it seems to me that you should not be trying to reference the hidden alias at all, (after all it is hidden). Instead SimpleLibClient/de/dbt/simplelibclient/SimpleCPPLib.o ought to be referencing the unaliased symbol [de::dbt::simplelibclient::SimpleCPPLib::square(int)] which *is* exported from libSimpleCPPLib.so. So to me this implies that this is a java compiler (gcj) problem.

If there is a good reason for referencing the hidden alias then the problem is either that you should not be linking against the libSimpleCPPLib.so library but instead linking against the object file, or that the transformation of SimpleCPPLib.o into libSimpleCPPLib.so should not be transforming the globally visible hidden alias into a local-only hidden alias.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]