[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/24074] ld fails silently when linking MinGW 64-bit app wit
From: |
nickc at redhat dot com |
Subject: |
[Bug binutils/24074] ld fails silently when linking MinGW 64-bit app with BOINC libs |
Date: |
Wed, 09 Jan 2019 11:32:01 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=24074
Nick Clifton <nickc at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |nickc at redhat dot com
--- Comment #2 from Nick Clifton <nickc at redhat dot com> ---
(In reply to Daniel from comment #0)
Hi Daniel,
> I was trying to link 64-bit MinGW app using crosscompiler on CentOS Linux.
Is the bionic library very big ? Mysterious failures like this are often
caused by the system running out of resources. Usually memory or disk space.
> GNU ld (GNU Binutils) 2.25
2.25 is an old version of the binutils. We are currently on release 2.31...
> /root/gcc-8.2.0-mingw64/lib/gcc/x86_64-w64-mingw32/8.2.0/crtend.o succeeded
> /root/gcc-8.2.0-mingw64/lib/gcc/x86_64-w64-mingw32/8.2.0/crtend.ocollect2:
> error: ld returned 1 exit status
> #2 0x0000000000418160 in ldwrite () at ../../ld/ldwrite.c:590
Sadly that bit of code is very unhelpful:
if (!bfd_final_link (link_info.output_bfd, &link_info))
{
/* If there was an error recorded, print it out. Otherwise assume
an appropriate error message like unknown symbol was printed
out. */
if (bfd_get_error () != bfd_error_no_error)
einfo (_("%F%P: final link failed: %E\n"));
else
xexit (1); <==== this is line 590
}
So the linker is terminating, and hoping that an error message has already
been displayed. :-(
> /usr/lib/gcc/x86_64-w64-mingw32/7.4.0/../../../../x86_64-w64-mingw32/bin/ld:
> BFD (GNU Binutils) 2.29.1.20171006 assertion fail /cygdrive/i/szsz
> /tmpp/cygwin64/mingw64-x86_64/mingw64-x86_64-binutils-2.29.1.787c9873-1.x86_64
> /src/binutils-gdb/bfd/cofflink.c:265
OK, well that assertion is checking that size of ordinary symbols and
auxillary symbols is the same:
BFD_ASSERT (symesz == bfd_coff_auxesz (abfd));
Is it possible for you to find these two values ? I have a theory that
the problem is that one or maybe both of them has not been initialised.
On Linux this probably goes undetected because allocated memory is usually
zeroed, even if not explicitly requested by the program. But under mingw32
the memory could contain any random value. That is just a guess however.
Cheers
Nick
BFD_ASSERT (symesz == bfd_coff_auxesz (abfd));
--
You are receiving this mail because:
You are on the CC list for the bug.