Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Linux SO equivalent of Windows DllMain in DLL

883 views
Skip to first unread message

Jeffrey Walton

unread,
Dec 9, 2009, 5:32:13 PM12/9/09
to
Hi All,

I don't believe it exists, but I wanted to ask for completeness. Does
a Linux SO offer an enrty point equivalent to DllMain in the Windows
world? I did find __attribute__ ((constructor)) [1], but I have not
been able to locate much practical reading material.

I'm working on a FIPS compliant module, and I'm trying to locate a
home for an automatic PowerUpSelfTest.

Thanks,
Jeffrey Walton

[1] http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html

Måns Rullgård

unread,
Dec 9, 2009, 5:40:38 PM12/9/09
to
Jeffrey Walton <nolo...@gmail.com> writes:

> Hi All,
>
> I don't believe it exists, but I wanted to ask for completeness. Does
> a Linux SO offer an enrty point equivalent to DllMain in the Windows
> world?

It would help of you described briefly what that function does and/or
when it is invoked.

> I did find __attribute__ ((constructor)) [1], but I have not
> been able to locate much practical reading material.

Functions marked with that attribute will be called by the startup
code before main() is invoked. It is the same mechanism that calls
constructors for static objects in C++, hence the name.

--
M�ns Rullg�rd
ma...@mansr.com

0 new messages