On Tuesday 23 September 2025 17:15:51 Antonin Décimo wrote:
> Impressive detective work! Thanks a lot ;)
> I'll close my bug report.
Now, when I'm thinking about your bug report... it is probably still
valid. For example I would want to have a variable in which would be
stored number of running threads plus 10. Pseudocode of such thing:
static int my_var = 10;
void tls_callback(...)
{
if (process attached or new thread created)
atomic_inc(&my_var);
else if (exiting process detached or thread exiting)
atomic_dec(&my_var);
}
/* register tls_callback */
int main() { do something ... }
And due to that bug, the above code would not work as all threads
(including the main thread) created before main function enters are not
counted.
So I think the bug report is valid. LTO optimizer should initialize
global variables of simple types before executing early TLS callbacks.
> > So the "extern const PIMAGE_TLS_CALLBACK __xl_f;" line is really
> > unnecessary as I originally thought.
>
> That's also a relief!
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public