On Saturday 24 December 2022 03:17:57 LIU Hao wrote:
> 在 2022-12-24 01:43, Pali Rohár 写道:
> > Ou right. They would also require __attribute__((used)) for LTO builds.
> > I just tested simple single process/thread console applications and they
> > worked.
> > 
> > Do you have any test case application which would be affected if these
> > symbols are eliminated?
> 
> Does this program still have an output, with LTO?
> 
>   ```
>   typedef void atexit_func(void*);
>   extern int __cxa_thread_atexit(atexit_func*, void*, void*);
>   extern void* __dso_handle;
>   extern int puts(const char*);
> 
>   int
>   main(void)
>     {
>       /* print a string upon the current thread's exit.  */
>       __cxa_thread_atexit((atexit_func*) puts, "test thread atexit",
>                           &__dso_handle);
>     }
>   ```
> 
> This attempts to call the `__cxa_thread_atexit` from mingw-w64 CRT instead
> of the one provided by libgcc. If TLS facilities are optimized out then
> there will be no output.

I just quickly tested it only in wine. Without LTO it prints "ł$"
(really strange, looks like some memory problem, maybe in wine?).

And with LTO it prints nothing. When I added __attribute__((used)) for
those 3 symbols then it started printing "ő<".


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

Reply via email to