[Bug ld/19531] New: ld fails to build proper executables in several cases on x64_64-w64-mingw32
https://sourceware.org/bugzilla/show_bug.cgi?id=19531 Bug ID: 19531 Summary: ld fails to build proper executables in several cases on x64_64-w64-mingw32 Product: binutils Version: 2.26 Status: NEW Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: rai...@emrich-ebersheim.de Target Milestone: --- Created attachment 8929 --> https://sourceware.org/bugzilla/attachment.cgi?id=8929=edit test case I first discovered this by bootstrapping gcc and running the testsuite. I got around 1200 new failures for the same gcc revision using binutils-2.26 compared to using binutils-2.25.1, see https://gcc.gnu.org/ml/gcc-testresults/2016-01/msg02756.html and https://gcc.gnu.org/ml/gcc-testresults/2016-01/msg02757.html Most failures in the libstdc++ testsuite, 954 additional failures. Besides the new failures, some tests which PASS and a some which FAIL allocate huge memory spaces, over 40 GByte. So I tried to analyze a bit. I picked a test case from the libstdc++ testsuite 22_locale/locale/cons/6.cc. Checking the preprocessed source, the assemply and the object files for the support library and the test case itself there's no difference. I disabled all debug information for an easier comparison. The objects are identical for both versions. I attach a test archive containing the support library and the object file, two versions of the executable and the two dlls libstdc++-6.dll and libgcc_s_seh-1.dll to run the executables on a windows system. The executable 6-2.15.1.exe is the one which is linked using ld-2.15.1, the executable 6-2.16.exe is the one which is linked using ld-2.16. The first one is fine the latter isn't. I don't know how to analyze any further. Can someone have a look, please. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19531] ld fails to build proper executables in several cases on x64_64-w64-mingw32
https://sourceware.org/bugzilla/show_bug.cgi?id=19531 Rainer Emrichchanged: What|Removed |Added Target||x86_64-w64-mingw32 Host||x86_64-w64-mingw32 Build||x86_64-w64-mingw32 -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19531] ld fails to build proper executables in several cases on x64_64-w64-mingw32
https://sourceware.org/bugzilla/show_bug.cgi?id=19531 --- Comment #1 from Rainer Emrich--- Ah, forgot the linking command: g++ -shared-libgcc -fmessage-length=0 -ffunction-sections -fdata-sections -g0 -O2 -fno-diagnostics-show-caret -fdiagnostics-color=never ./6.o ./libtestc++.a -Wl,--gc-sections -liconv -lm -o 6.exe -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19533] Replace == in test conditional with =
https://sourceware.org/bugzilla/show_bug.cgi?id=19533 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by H.J. Lu: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=621ff761b3ca490233e347411067da9ab72c8d65 commit 621ff761b3ca490233e347411067da9ab72c8d65 Author: H.J. Lu Date: Fri Jan 29 07:47:13 2016 -0800 Replace == with = in ld/configure.ac PR ld/19533 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/19532] Please improve POSIX shell compatibility of gas/configure.ac
https://sourceware.org/bugzilla/show_bug.cgi?id=19532 --- Comment #2 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by H.J. Lu: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=348ef89a5443529b2a67fa9d247debf3e707a4bd commit 348ef89a5443529b2a67fa9d247debf3e707a4bd Author: H.J. Lu Date: Fri Jan 29 07:47:45 2016 -0800 Replace == with = in gas/configure.ac PR gas/19532 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/19532] Please improve POSIX shell compatibility of gas/configure.ac
https://sourceware.org/bugzilla/show_bug.cgi?id=19532 H.J. Lu changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |2.27 --- Comment #1 from H.J. Lu --- Fixed. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19533] Replace == in test conditional with =
https://sourceware.org/bugzilla/show_bug.cgi?id=19533 H.J. Lu changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED Target Milestone|--- |2.27 --- Comment #1 from H.J. Lu --- Fixed. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug gas/19532] Please improve POSIX shell compatibility of gas/configure.ac
https://sourceware.org/bugzilla/show_bug.cgi?id=19532 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The binutils-2_26-branch branch has been updated by H.J. Lu: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3c9d874373f2189cb704999b0ba39b9bbca91a61 commit 3c9d874373f2189cb704999b0ba39b9bbca91a61 Author: H.J. Lu Date: Fri Jan 29 07:47:45 2016 -0800 Replace == with = in gas/configure.ac Backport from master PR gas/19532 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19533] Replace == in test conditional with =
https://sourceware.org/bugzilla/show_bug.cgi?id=19533 --- Comment #3 from cvs-commit at gcc dot gnu.org --- The binutils-2_26-branch branch has been updated by H.J. Lu: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=52b756da0b372cb7cc1a18b22415cd36f89f90e6 commit 52b756da0b372cb7cc1a18b22415cd36f89f90e6 Author: H.J. Lu Date: Fri Jan 29 07:47:13 2016 -0800 Replace == with = in ld/configure.ac Backport from master PR ld/19533 * configure.ac (compressed_debug_sections): Replace == with =. * configure: Regenerated. -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19526] Using "gcc -o /dev/null" gives "ld: final link failed: File truncated" error
https://sourceware.org/bugzilla/show_bug.cgi?id=19526 --- Comment #2 from dave.anglin at bell dot net --- On 2016-01-29 4:17 PM, deller at gmx dot de wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=19526 > > --- Comment #1 from Helge Deller --- > The debian "libbsd" package fails because of the same issue: > > gcc -isystem ../include/bsd -I.. -include ../config.h > -DLIBBSD_DISABLE_DEPRECATED -D__REENTRANT -DLIBBSD_OVERLAY > headers-overlay-gen.c -o /dev/null > /usr/bin/ld: final link failed: File truncated > collect2: error: ld returned 1 exit status > FAIL headers-overlay.sh (exit status: 1) > > Full log: > https://buildd.debian.org/status/fetch.php?pkg=libbsd=hppa=0.8.2-1=1453935236 > I have built a debug version of binutils. I'll see if I can find problem this weekend. Dave -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19526] Using "gcc -o /dev/null" gives "ld: final link failed: File truncated" error
https://sourceware.org/bugzilla/show_bug.cgi?id=19526 --- Comment #3 from dave.anglin at bell dot net --- It's not necessary to use a pipe to duplicate. I created a file xxx.c with 'int main(){}' and compiled with -save-temps and -Wl,-debug to get the actual link command. Here is backtrace for bfd_error_file_truncated: Breakpoint 4, bfd_set_error (error_tag=724328) at ../../src/bfd/bfd.c:511 511 va_start (ap, error_tag); (gdb) step 503 { (gdb) 504 bfd_error = error_tag; (gdb) 505 if (error_tag == bfd_error_on_input) (gdb) p bfd_error $3 = bfd_error_file_truncated (gdb) bt #0 bfd_set_error (error_tag=bfd_error_file_truncated) at ../../src/bfd/bfd.c:505 #1 0xfd1ade30 in cache_bread_1 (abfd=0xaecb0, buf=0x257978, nbytes=256) at ../../src/bfd/cache.c:347 #2 0xfd1adf60 in cache_bread (abfd=0xaecb0, buf=0x257978, nbytes=256) at ../../src/bfd/cache.c:368 #3 0xfd1ac17c in bfd_bread (ptr=0x257978, size=256, abfd=0xaecb0) at ../../src/bfd/bfdio.c:196 #4 0xfd1b6000 in _bfd_generic_get_section_contents (abfd=0xaecb0, section=0xb0850, location=0x257978, offset=0, count=256) at ../../src/bfd/libbfd.c:812 #5 0xfd1ca458 in bfd_get_section_contents (abfd=0xaecb0, section=0xb0850, location=0x257978, offset=0, count=256) at ../../src/bfd/section.c:1619 #6 0xfd1af8c4 in bfd_get_full_section_contents (abfd=0xaecb0, sec=0xb0850, ptr=0xfd7034d0) at ../../src/bfd/compress.c:253 #7 0xfd1ca4d8 in bfd_malloc_and_get_section (abfd=0xaecb0, sec=0xb0850, buf=0xfd7034d0) at ../../src/bfd/section.c:1640 #8 0xfd1ddb4c in elf_hppa_sort_unwind (abfd=0xaecb0) at ../../src/bfd/elf-hppa.h:1196 #9 0xfd1e6030 in elf32_hppa_final_link (abfd=0xaecb0, info=0x9f5b0 ) at ../../src/bfd/elf32-hppa.c:3257 #10 0x00049010 in ldwrite () at ../../src/ld/ldwrite.c:581 #11 0x00043bd8 in main (argc=38, argv=0xfd70302c) at ../../src/ld/ldmain.c:430 (gdb) frame 8 #8 0xfd1ddb4c in elf_hppa_sort_unwind (abfd=0xaecb0) at ../../src/bfd/elf-hppa.h:1196 1196 if (!bfd_malloc_and_get_section (abfd, s, )) (gdb) p *abfd $4 = {filename = 0xb0d58 "/dev/null", xvec = 0xfd2d07b8 , iostream = 0xb0d68, iovec = 0xfd2c90a0 , lru_prev = 0xc5738, lru_next = 0x118568, where = 2228, mtime = 0, id = 0, format = bfd_object, direction = write_direction, flags = 386, cacheable = 1, target_defaulted = 0, opened_once = 1, mtime_set = 0, no_export = 0, output_has_begun = 1, has_armap = 0, is_thin_archive = 0, selective_search = 0, is_linker_output = 1, is_linker_input = 0, plugin_format = bfd_plugin_uknown, lto_output = 0, plugin_dummy_bfd = 0x0, origin = 0, proxy_origin = 0, section_htab = {table = 0x232490, newfunc = @0xfd42031e: 0xfd1c8b08 , memory = 0xafd60, size = 61, count = 31, entsize = 184, frozen = 0}, sections = 0xafdc0, section_last = 0x232878, section_count = 27, archive_pass = 0, start_address = 66496, outsymbols = 0x0, symcount = 93, dynsymcount = 0, arch_info = 0xfd2d1140 , arelt_data = 0x0, my_archive = 0x0, archive_next = 0x0, archive_head = 0x0, nested_archives = 0x0, link = {next = 0xb0ed0, hash = 0xb0ed0}, tdata = { aout_data = 0xaed80, aout_ar_data = 0xaed80, oasys_obj_data = 0xaed80, oasys_ar_data = 0xaed80, coff_obj_data = 0xaed80, pe_obj_data = 0xaed80, xcoff_obj_data = 0xaed80, ecoff_obj_data = 0xaed80, ieee_data = 0xaed80, ieee_ar_data = 0xaed80, srec_data = 0xaed80, verilog_data = 0xaed80, ihex_data = 0xaed80, tekhex_data = 0xaed80, elf_obj_data = 0xaed80, nlm_obj_data = 0xaed80, bout_data = 0xaed80, mmo_data = 0xaed80, sun_core_data = 0xaed80, sco5_core_data = 0xaed80, trad_core_data = 0xaed80, som_data = 0xaed80, hpux_core_data = 0xaed80, hppabsd_core_data = 0xaed80, sgi_core_data = 0xaed80, lynx_core_data = 0xaed80, osf_core_data = 0xaed80, cisco_core_data = 0xaed80, versados_data = 0xaed80, netbsd_core_data = 0xaed80, mach_o_data = 0xaed80, mach_o_fat_data = 0xaed80, plugin_data = 0xaed80, pef_data = 0xaed80, pef_xlib_data = 0xaed80, sym_data = 0xaed80, any = 0xaed80}, usrdata = 0x0, memory = 0xaed68, build_id = 0x0} Maybe skipping sort when filename is "/dev/null" will fix. Is there a better test? Dave -- John David Anglin dave.ang...@bell.net -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19526] Using "gcc -o /dev/null" gives "ld: final link failed: File truncated" error
https://sourceware.org/bugzilla/show_bug.cgi?id=19526 --- Comment #4 from dave.anglin at bell dot net --- On 2016-01-29, at 9:05 PM, John David Anglin wrote: > Maybe skipping sort when filename is "/dev/null" will fix. Untested fix. -- John David Anglin dave.ang...@bell.net -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils
[Bug ld/19526] Using "gcc -o /dev/null" gives "ld: final link failed: File truncated" error
https://sourceware.org/bugzilla/show_bug.cgi?id=19526 --- Comment #1 from Helge Deller --- The debian "libbsd" package fails because of the same issue: gcc -isystem ../include/bsd -I.. -include ../config.h -DLIBBSD_DISABLE_DEPRECATED -D__REENTRANT -DLIBBSD_OVERLAY headers-overlay-gen.c -o /dev/null /usr/bin/ld: final link failed: File truncated collect2: error: ld returned 1 exit status FAIL headers-overlay.sh (exit status: 1) Full log: https://buildd.debian.org/status/fetch.php?pkg=libbsd=hppa=0.8.2-1=1453935236 -- You are receiving this mail because: You are on the CC list for the bug. ___ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils