Subject: Re: cygwin, libtool, dlpreopen, and .rdata
From: "Gary V.Vaughan" <[email-masked]>
To: Charles Wilson <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Wed, 22 Sep 2004 08:43:00 +0100

Hi Chuck!

On 22 Sep 2004, at 07:31, Charles Wilson wrote:
> Because lt_preloaded_symbols[] is an array of const structs, it is 
> placed in .rdata.  However, the "nothing" symbol is a DATA export from 
> cyghello-2.dll -- so the runtime psuedo-reloc machinery needs to fixup 
> the address stored in "lt_preloaded_symbols[3].address" to point to 
> the actual, relocated memory location of the "nothing" variable.
>
> But it can't, because .rdata is non-writable.  However, this is a 
> *runtime* error; the *link* succeeds.  But when you run the app, you 
> get a popup window declaring:
>
> "The application failed to initialize properly (0xc0000005). Click on 
> OK to terminate the application."

Woah, it's just like the old days when we were all afraid of DATA 
exports on windows ;-)

> 2004-09-21  Charles Wilson  <[email-masked]>
>
> 	* config/ltmain.in (func_generate_dlsyms): addresses
> 	in _preloaded_symbols[] cannot go into .rdata section
> 	if symbols are DATA imported from DLL, on windows,
> 	because runtime relocations must happen.
> 	* m4/libtool.m4 (_LT_LINKER_SHLIBS([TAGNAME])):
> 	build exports for symbols in .rdata sections

Excellent catch.  Applied.  Thankyou very much!

Cheers,
	Gary.
- --
Gary V. Vaughan      ())_.  gary@{lilith.warpmail.net,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/