On Tue, 3 Dec 2024, Pali Rohár wrote:
On Tuesday 03 December 2024 16:19:58 Martin Storsjö wrote:
On Wed, 27 Nov 2024, Pali Rohár wrote:
For EXE builds __mingw_init_ehandler() function is called after the
_pei386_runtime_relocator() from the __tmainCRTStartup() (and not from the
WinMainCRTStartup() function).
Do same for DLL builds and call __mingw_init_ehandler() from
__DllMainCRTStartup() instead of DllMainCRTStartup().
---
mingw-w64-crt/crt/crtdll.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
I think this change might be ok, but it would be nice to explain a bit about
the motivation for the change; is this something that you've functionally
noticed that needs to be tweaked, or just that you noticed that it was
inconsistent? (And in this case, explain your reasoning why you think this
is the wrong location to call it and why crtexe.c's place is more correct.)
Originally I just notices that it is inconsistent and did not understand
why it is called before anything else and on moreover strange place. I
looked into git history but there is no information or comment about it.
But I think that in some case, if the __mingw_init_ehandler is calling
some function which depends on runtime-pseudo-reloc then it is needed to
be called after the _pei386_runtime_relocator().
I think __mingw_init_ehandler only should call system APIs, not any user
code which may require the runtime pseudo relocations, so I don't think
it's much of a practical issue - but consistency is good anyway; I'll push
this with an amended commit message.
// Martin
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public