This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
equivalent to '-fini' and '-init' for Sun ld?
- To: binutils at sources dot redhat dot com
- Subject: equivalent to '-fini' and '-init' for Sun ld?
- From: Heiko Nardmann <h dot nardmann at secunet dot de>
- Date: Tue, 14 Aug 2001 08:57:47 +0200
- Organization: secunet Security Networks AG
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am in the process of porting a project from Linux to SunOS. The project
contains a shared object with its own _init and _fini functions. But as far
as I can tell the Sun ld does not provide a mechanism to define _init and
_fini. So I get the following error message:
g++ -Wall -Iinclude -DWRAP_MALLOC -DWRAP_OPEN -DWRAP_FREAD -DWRAP_FCLOSE
- -DWRAP_FSEEK -DWRAP_STAT -DWRAP_FOPEN -DWRAP_TIME -fpic
- -fPIC -g -c source/wrapper.cpp -o obj.SunOS-sun4u/wrapper.o
g++ -Wall -g -shared -o bin.SunOS-sun4u/wrapper.so obj.SunOS-sun4u/wrapper.o
- -ldl -lsocket -lnsl
ld: fatal: symbol `_init' is multiply defined:
(file /opt/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crti.o
and file obj.SunOS-sun4u/wrapper.o);
ld: fatal: symbol `_fini' is multiply defined:
(file /opt/gcc-2.95.2/lib/gcc-lib/sparc-sun-solaris2.7/2.95.2/crti.o
and file obj.SunOS-sun4u/wrapper.o);
ld: fatal: File processing errors. No output written to
bin.SunOS-sun4u/wrapper.so
collect2: ld returned 1 exit status
make: *** [bin.SunOS-sun4u/wrapper.so] Error 1
Can anyone tell me what to do here?
Thanks in advance!
- --
Heiko Nardmann (Dipl.-Ing.), h.nardmann@secunet.de, Software Development
secunet Security Networks AG - Sicherheit in Netzwerken (www.secunet.de),
Weidenauer Str. 223-225, D-57076 Siegen
Tel. : +49 271 48950-13, Fax : +49 271 48950-50
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE7eMvspm53PRScYygRAqwAAKC86OJGL0Rl6xAd5BMoWbXFtpXoMwCeOTgx
iAAe+n33WuLwCCAASlsatgQ=
=EkQf
-----END PGP SIGNATURE-----