Tuesday December 19, 2006 | Surfing With a Linker Alien Rod Evans's Weblog |
|
'_init'/'_fini' not found - use the compiler drivers
A recently added error check within
ld: warning: symbol `_init' not found, but .init section exists - \
possible link-edit without using the compiler driver
ld: warning: symbol `_fini' not found, but .fini section exists - \
possible link-edit without using the compiler driver
The encapsulation, and execution of
Users typically create these sections using a
% cat foobar.c
static int foobar = 0;
#pragma init (foo)
void foo()
{
foobar = 1;
}
#pragma fini (bar)
void bar()
{
foobar = 0;
}
The functions themselves are placed in a
This is where the compiler drivers come in. As part of creating a dynamic
object, the compiler drivers provide input files that encapsulate the
_init { # provided by
It is the symbols
Some folks are using
This leaves the developer wondering why their
It's best not to use Technorati Tag: OpenSolaris Technorati Tag: Solaris (2006-12-19 14:43:49.0) Permalink Comments [2] Post a Comment: Comments are closed for this entry. |
|
||||
Posted by UX-admin on December 20, 2006 at 08:08 AM PST #
I'm not sure I understand your question.
The point of this posting was to show how the code produced by the compilation system for such things as .init sections, it tied to an encapsulation model provided with files that the compiler drivers deliver.
Regardless of these special sections, you still need a special crt file to provide the standard calling sequence to main(argc, argv).
It is safest to use a compiler driver to generate a final dynamic object.
Posted by Rod Evans on December 20, 2006 at 09:08 AM PST #