This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
getting custom _init / _fini functions in a dynamic library
- From: "Christoph Baumann" <cb at sorcus dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Thu, 16 Jan 2003 12:49:01 +0100
- Subject: getting custom _init / _fini functions in a dynamic library
- Organization: SORCUS Computer GmbH
- Reply-to: "Christoph Baumann" <cb at sorcus dot com>
Hello,
the library I'm working on works so far (programs using it can be linked
against it and do what I expected), but I failed to get my own _init /_fini
functions working. According to the "Program Library HOWTO" I declared my
own functions (void _init(void); ) and used the -nostartfiles option. The
resulting library contained the symbols _init_Fv and _fini_Fv but they
wheren't used. I also tried to declare the functions with
__attribute__((constructor)) / ((destructor)) which didn't work either. As a
third method I tried the -init and -fini options of the linker, but to no
avail.
I'm using g++-3.0 on a i386 platform. Is there any known problem/solution?
Mit freundlichen Gruessen / Best regards
Dipl.-Phys. Christoph Baumann
---
SORCUS Computer GmbH
Im Breitspiel 11 c
D-69126 Heidelberg
Tel.: +49(0)6221/3206-0
Fax: +49(0)6221/3206-66