What's going on with multiple defintion of .refptr._CRT_MT?

sotrdg sotrdg euloanty@live.com
Wed Oct 15 09:51:41 GMT 2025


Come to QQ group 801441303 to explain to me what's going on. Thank you



________________________________
From: LIU Hao
Sent: Wednesday, October 15, 2025 17:50
To: sotrdg sotrdg; ebotcazou@adacore.com
Cc: gcc-help
Subject: Re: What's going on with multiple defintion of .refptr._CRT_MT?

在 2025-10-15 17:37, sotrdg sotrdg via Gcc-help 写道:
> .dll.tmp ./shlib/libgcc_s_seh-1.dll && mv ./shlib/libgcc_s.a.tmp ./shlib/libgcc_s.a
> /home/cqwrteur/toolchains/gnu/x86_64-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/bin/ld: /home/cqwrteur/toolchains/gnu/x86_64-linux-gnu/x86_64-w64-mingw32/x86_64-w64-mingw32/lib/libmingw32.a(lib64_libmingw32_a-tlssup.o):tlssup.c:(.rdata$.refptr._CRT_MT+0x0): multiple definition of `.refptr._CRT_MT'; gthr-win32-thread_s.o:gthr-win32-thread.c:(.rdata$.refptr._CRT_MT[.refptr._CRT_MT]+0x0): first defined here
> collect2: error: ld returned 1 exit status
> make[2]: *** [Makefile:1009: libgcc_s.dll] Error 1
> make[2]: Leaving directory '/home/cqwrteur/toolchains_build/gcc_build/x86_64-linux-gnu/x86_64-w64-mingw32/gcc/x86_64-w64-mingw32/libgcc'
> make[1]: *** [Makefile:15823: all-target-libgcc] Error 2
> make[1]: Leaving directory '/home/cqwrteur/toolchains_build/gcc_build/x86_64-linux-gnu/x86_64-w64-mingw32/gcc'
> make: *** [Makefile:1069: all] Error 2

The section name `.rdata$.refptr._CRT_MT[.refptr._CRT_MT]` doesn't look right. It should be
`.rdata$.refptr._CRT_MT`. I tried building master branch yesterday on x86_64-w64-mingw32 yesterday, and
the new GCC gives the correct output, which looks like this:

         .section        .rdata$.refptr._CRT_MT, "dr"
         .p2align        3, 0
         .globl  .refptr._CRT_MT
         .linkonce       discard
    .refptr._CRT_MT:
         .quad   _CRT_MT


You might take a look into how 'gthr-win32-thread_s.o' was compiled, and what the assembly output should
look like.


--
Best regards,
LIU Hao


More information about the Gcc-help mailing list