[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/4266] New: hidden alias not found while linking gcj compiled Jav
From: |
mail at andreas-buergel dot de |
Subject: |
[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: |
22 Mar 2007 22:13:02 -0000 |
Hi folks,
I've got a test Java class with a single native method. The native method lives
in a C++ shared library and is implemented with gcj's CNI. The lib compiles fine
and a Linux shared object file is created. The java class compiles fine into an
object file, but when linking the executable the linker complains about
undefined references to a hidden alias:
de/dbt/simplelibclient/SimpleCPPLib.o:(.data.rel+0xc): undefined reference to
`hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)'
de/dbt/simplelibclient/SimpleCPPLib.o:(.data.rel+0x68): undefined reference to
`hidden alias for de::dbt::simplelibclient::SimpleCPPLib::square(int)'
When linking directly to the object file - SimpleCPPLib.o - the library consists
of and not the library - libSimpleCPPLib.so - itself, an executable is created
without errors.
(Don't be confused about SimpleCPPLib.o. There are two of them. The Java class
compiles to a SimpleCPPLib.o and the C++ class implementing the native method
also compiles to a SimpleCPPLib.o.)
I put all relevant files into a tar archive "simplecpplib_sample.tar.bz2"
attached to this mailing list mail (is it possible to attach a file to a
bugzilla report?):
http://sources.redhat.com/ml/binutils/2007-03/msg00321.html
I can reproduce problem
- on an Athlon-XP system running openSUSE 10.2
- on a Pentium-Core2-Duo system running openSUSE 10.2
- on an Athlon-XP system running Kubuntu 6.1
products used
- gcc/gcj 4.1.2 (on all systems)
- binutils 2.17 (on all systems)
- glibc 2.5 (on all systems)
- Linux kernel 2.6.18.8 (on openSUSE Athlon-XP system)
I also reproduced the problem (on the openSUSE Athlon-XP system) with
- gcc/gcj 4.1.2 built from the current release sources (with and without
--enable-bootstrap configure option)
- gcc/gcj 4.2.0 from the snapshot sources of 2007/03/07
- binutils 2.17 built from the current release sources
I also tested different compiler optimizations when building gcc/gcj and
binutils
- -O2 -march=athlon-xp -mmmx -m3dnow -msse -mfpmath=sse
- -O2 -m486
- -O2
which seems to have no effect
Thanks in advance.
--
Summary: hidden alias not found while linking gcj compiled Java
class with native C++ lib and CNI binding under Linux
x86
Product: binutils
Version: 2.17
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: mail at andreas-buergel dot de
CC: bug-binutils at gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://sourceware.org/bugzilla/show_bug.cgi?id=4266
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/4266] New: hidden alias not found while linking gcj compiled Java class with native C++ lib and CNI binding under Linux x86,
mail at andreas-buergel dot de <=