On Wed Jan 14 00:23:26 2026 +0000, Yuxuan Shui wrote:
Thanks. I've tested it and it works for me as well. * * * Can you help me understand why my attempt doesn't work?
`_initterm` and `_initterm_e` need to be in separate object files to avoid duplicate symbol Yeah I have [that](https://gitlab.winehq.org/wine/wine/-/merge_requests/9265/diffs?commit_id=e7...) as well. using `__ASM_GLOBAL_IMPORT` Thanks. Adding it fixed this error for me:
NOTE: a relevant symbol '_initterm' is available in dlls/winecrtend/x86_64-windows/libwinecrtend.a but cannot be used because it is not an import library.But I am still getting `error: duplicate symbol: __initterm`. My failed attempt is [here](https://gitlab.winehq.org/yshui/wine/-/commits/ctor-dtor-dup-symbols) Oh, I need to add `__ASM_GLOBAL_IMPORT` to data.c as well? But why does that fix the duplicate symbol problem?
Hmm, I think I understand now. `crt_dllmain.o` is pulling in the `__imp__initterm` symbol, not the `_initterm` symbol itself. So I need to provide that to prevent `initerm.o` from being linked. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9265#note_126882