On Saturday 08 October 2022 20:07:56 LIU Hao wrote:
> 在 2022/10/8 19:10, Pali Rohár 写道:
> > _HUGE global variable is available and exported from crtdll and msvcrt
> > libraries. So declare it explicitly via _CRTIMP as global variable and not
> > via __MINGW_IMP_SYMBOL pointer.
> > ---
> 
> I suspect you are linking to the `_HUGE` in 'math/_huge.c'.
> 
> 
> > I'm really not sure what was the reason to define _HUGE via macro
> > __MINGW_IMP_SYMBOL poinster. So maybe there is a reason which I do not
> > see. I marked this patch as RFC, so please properly review it.
> > 
> 
> Data and functions that are exported from a DLL are required to be accessed
> via an `__imp_*` pointer, because their addresses are unknown and would have
> failed the linker; only the address of `__imp_*` pointers are known.
> 
> For functions it appears that it is possible to call them without
> `dllimport`, but in reality, the import libraries - '*.dll.a' files -
> contain normal function wrappers that delegate to `__imp_*` pointers.
> 
> And that is also what `DATA` does in DEF files: It suppresses generation of 
> these plain wrappers.

Is not _CRTIMP automatically marking variable with dllimport and
instruct compiler to convert variable name to __imp_name* pointer?


_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to