[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/26198] Failure to merge read only data of machine code object fi
From: |
nickc at redhat dot com |
Subject: |
[Bug ld/26198] Failure to merge read only data of machine code object file and LTO object file on MinGW |
Date: |
Thu, 09 Jul 2020 13:58:22 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=26198
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nickc at redhat dot com
--- Comment #1 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Markus Böck from comment #0)
Hi Markus,
> c:/gcc/bin/../lib/gcc/x86_64-w64-mingw32/10/../../../../x86_64-w64-mingw32/
> bin/ld.exe: test2.o (symbol from
> plugin):(.gnu.linkonce.t._ZNKSt9type_info4nameEv+0x0): multiple definition
> of `std::type_info::name() const';
> test1.o:test.cpp:(.
> Failed to reproduce this issue with a linux target
I think that this might be a compiler issue, rather than an assembler issue...
> nm output of test1.o:
> 0000000000000000 T _ZNKSt9type_info4nameEv
> 0000000000000000 T _ZNKSt9type_info9hash_codeEv
> gcc-nm output of test2.o:
> 00000000 T _ZNKSt9type_info4nameEv
> 00000000 T _ZNKSt9type_info9hash_codeEv
Using gcc v9 on an x86_64 linux box to compile the test I found
that those symbols are declared as weak:
% gcc-nm test1.o
[...]
0000000000000000 W _ZNKSt9type_info4nameEv
0000000000000000 W _ZNKSt9type_info9hash_codeEv
% gcc-nm test2.o
[...]
00000000 W _ZNKSt9type_info4nameEv
00000000 W _ZNKSt9type_info9hash_codeEv
Which explains why it works for me. My guess is that gcc thinks that
it cannot generate weak symbols for the COFF/PE environment of Mingw,
or something along those lines. Perhaps you can investigate the output
from your gcc to see if this guess is correct ?
Cheers
Nick
--
You are receiving this mail because:
You are on the CC list for the bug.