revised x86_64-pc-mingw32 patch

Richard Henderson rth@redhat.com
Thu Mar 22 17:43:00 GMT 2007


On Thu, Mar 22, 2007 at 11:44:56AM +0100, Kai Tietz wrote:
> >   extern int i;
> >   int f(void) { return i; }
> > 
> > that "i" *cannot* be resolved from a dllimport?  If not,
> > what does VC++ do with the generated code?
> 
> Yes the variable i can not be resolved by MS from a dllimport.

Excellent.  This means that dllimport can be *significantly* 
cleaned up in the gcc port.

> If you use something like
>    extern __declspec(dllimport) int i;
>    int *my_i_ptr = &i;
>    int f(void) { return *my_i_ptr; }
> 
> MS packs the initialization code for that into the pdata section and marks 
> the initialization method within CRT$XCU (crt startup section executed by 
> terminit) section, too.

Interesting.  I'll have to think about this one.  Presumably our
existing constructor support for mingw uses the same method?

> I Noticed, that you disabled the TARGET_DEBUG_ARG if-case in funtion in 
> init_cumulative_args. Was this by intension done ?

Yeah, I think such debuggings are pretty pointless.  It's far easier
to just run the compiler under gdb.


r~



More information about the Gcc-patches mailing list