[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Re: RFC - Winelib constructor init problem
From:       Bertho Stultiens <bertho () panter ! soci ! aau ! dk>
Date:       2000-07-31 8:00:49
[Download RAW message or body]

Jeremy White wrote:
[snip]
> 3.   Intercept ctors processing
> 	In this  case, best demostrated by Berthos, I believe, you
> 	intercept the ctors process of your target library (say, MFC).
>	You stash a pointer to the ctors chain somewhere, and
>	then force the glibc processing code to return immediately.
>	Later, during 'normal' library initialization (invoked
>	after main()), you walk the rest of the ctors chain.
> 
> 	This option would be more appealing to me if there was a
>	formal way to accomplish this with linker scripts, rather than
>	with a hack.

You can only do this trick with linker-scripts if it is possible to
direct the compiler to emit {con,de}structor code into another section
than .init and .fini. Otherwise, you would have no real "clean" way of
doing it (oh well, hacking .init and .fini is never clean). However, a
relatively harmless hack is to use an intermediate link-stage, where you
incrementally link the entire source, then rename the .init and .fini
section (with objcopy), and then link it with an extra object (that
contains the redirector code) and a special linker-script.

Greetings Bertho

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic