This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Calling constructor functions manually


Dnia 15 Października 2010, 00:22, Pt, Ian Lance Taylor napisał:
> "Michał Bieliński" <michal@kast.net.pl> writes:
>
>> Dnia 14 PaĹşdziernika 2010, 22:42, Cz, Ian Lance Taylor napisał:
>>> "Michał Bieliński" <michal@kast.net.pl> writes:
>>>
>>>> I am linking C object files which rely on functions with constructor
>>>> attribute with my program. Ordinarily gcc generates code calling all
>>>> such
>>>> routines before main gets control. However, my program is not written
>>>> in
>>>> C and such code is not included. Resulting executable works but linked
>>>> objects refuse to cooperate because their initializing constructors
>>>> were not called. Is there a way to manually run these functions?
>>>
>>> In general, yes.  However, the precise details depend greatly on your
>>> target.  So tell us more.
>>
[snip]
>> Is any other information needed?
>
> Sorry, I should have said.  What matters here is your operating system
> and your libc.

Linux 2.6.35-ARCH i686 GNU/Linux
libc-2.12.1.so

Does the solution you have on mind break code portability?

-- 
Michal Bielinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]