> From: [email protected] (Niels Möller)
> Date: Wed, 22 Apr 2020 21:48:31 +0200
>
> I have a question to the list, if anyone here knows details of how
> windows dlls work.
>
> I cross compile for windows with
>
> ./configure --host=x86_64-w64-mingw32 --enable-mini-gmp CXX=/bin/false
> make
>
> and run tests with
>
> make check EMULATOR=wine64
>
> It fails the ecc-dup and ecc-add tests, in this and similar asserts:
>
> ASSERT (ecc->dup == ecc_dup_jj);
>
> Here, the right hand side is a symbol from libhogweed-x.dll, and on the
> left hand side, ecc refers to a constant struct in the same dll.
Please tell more details, perhaps showing the code which obtains the
values of these variables. In particular, I don't understand what do
you mean by "symbol": this is C, and C doesn't have symbols as one of
its data types. And what is the purpose of this assertion?
> My guess us that dynamic linking on windows doesn't provide function
> pointer comparisons as specified by the C standard. Maybe left-hand side
> is the real function entry point, and the right hand side is the address
> of some glue code related to dynamic linking. Is that right? If so, I
> can just disable this assert for windows, but I'd like to understand
> what'g going on.
Yes, a DLL call is an indirect call through a function address in a
table, but to give you a detailed enough answer, I'd like to
understand the situation better.
> Somewhat related to this: The ecc pointer is taken from this array in
> testutils.c:
>
> const struct ecc_curve * const ecc_curves[] = {
> &_nettle_secp_192r1,
> &_nettle_secp_224r1,
> &_nettle_secp_256r1,
> &_nettle_secp_384r1,
> &_nettle_secp_521r1,
> &_nettle_curve25519,
> &_nettle_curve448,
> &_nettle_gost_gc256b,
> &_nettle_gost_gc512a,
> NULL
> };
>
> The entries are references to data objects in the dll. I'm a bit
> surprised that works at all, is it expected to work? I had the
> impression that dlls only exported functions.
No, DLLs can export variables as well, and programs linked against it
can import them.
_______________________________________________
nettle-bugs mailing list
[email protected]
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs