X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; q=dns; s=default; b=KgkINzlZWRbBgCR6TbpVOZlmNOgCnXsQMX3SbSEhiyr rdIboP90p+ZjRMZpV1yS4Tq2s7IdCVTle/nunFGBUj8I6Gdk7fSnU9ig0fMZlU1P UJBbYFT1Bq+w6n1WeH4KOqFnqqJZ8GChjSK/ukNhpG6NscP8Yf5d1q6X/BqjfmxE = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; s=default; bh=BBI6dqwyB7W6I8Vq2mYgXoFi4eY=; b=r/XsexR0Ns52MT7VL ZVydLdr7vKnGchhdSz3uK1u4stqIgAF0o6+rWm5O3GSHzEYIfwsq6KR1Pn5WW//f N0f4M0IwaHzWCLacRQgcAqm/D6WyUnEbkCHDouYAxIypBVhHZQkB6hZL9E6ewHvP AQBJfrPqQedWjSrBbYAIjiU8jc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=2.6 required=5.0 tests=BAYES_00,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy==a8=e9=a3, frozen, 2863, Hx-languages-length:7472?= X-HELO: mail-wm0-f49.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=LOMuJuLZ8XHAzP3zt4crSzCtPDamVH9hYGxrXY/mg1k=; b=pl+jNqSGWP5iEuA1kIl2XMWFZnOsg4D+aAXZDBsEuIE2+wEP5WysZofWFT9gRp1O6H qOvENs2f6TFMRGoadfEjKD68VHliqVFv/KGzpZ9XV3uXi3R5jU+1YB3lIf8tOIQfs4L/ /AUUdcRSmRiuxi9hOnxmEJtkOp5LRi0S2ObJYOc6ULkWlHKC8MihVx2F4OvOhKDbEAoU x0vZHLA1JQagSPIZxSNLsud1LUtTIIVa0LPlS2nLlntDm074w12Im/uyTM9t+oH/Oi65 g9uOF0O1WmwhomUTPAlIImXy8M6pChoCVXpqX1JqmEj1AOg4NwzLFkn1GRxDYEeGbbnC /1cA== X-Gm-Message-State: AHPjjUhDQOr7MPBvdXN5r5+cxa8FkA2TzuL0tlbIgajqyWwojvZGdV47 ahUfFbzEnTzH4hHkp9XKW2c7GV8GAo+6IH6U786ThDld X-Google-Smtp-Source: AOwi7QCm2/AdRuFX976qZCYrGEL+ZYMEhmKyVlYX63inLnHcunns0hzOJP+4U9q9Choo/W2fRiiBww0XTEzud4M3WK4= X-Received: by 10.28.203.196 with SMTP id b187mr518038wmg.126.1506522148548; Wed, 27 Sep 2017 07:22:28 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: =?UTF-8?B?5Y+26Zuo6aOe?= Date: Wed, 27 Sep 2017 07:21:57 -0700 Message-ID: Subject: Re: Error Linking LTO programs using GCC6.4 To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id v8REMkue019524 Okay, so I managed to extract more details using binutils-debuginfo package , but still has no clue how to solve this. OTOH, binutils 2.25 seems to be doing better Starting program: /usr/x86_64-pc-cygwin/bin/ld -plugin /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/cyglto_plugin.dll -plugin-opt=/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/lto-wrapper.exe -plugin-opt=-fresolution=/tmp/ccNFf1JQ.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcygwin -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id -m i386pep --wrap _Znwm --wrap _Znam --wrap _ZdlPv --wrap _ZdaPv --wrap _ZnwmRKSt9nothrow_t --wrap _ZnamRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --tsaware -o driver.exe -L/usr/lib/w32api /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib/crt0.o /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/crtbegin.o -L/usr/lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0 -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/lib -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../.. -v main.o libdriver.a -lpcre -lz -lcrypt -lpcre -levent -lstdc++ -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../lib/default-manifest.o /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/crtend.o [New Thread 6752.0x2d9c] [New Thread 6752.0x206c] [New Thread 6752.0x284c] [New Thread 6752.0x2278] [New Thread 6752.0x1154] GNU ld (GNU Binutils) 2.29.51.20170708 /usr/x86_64-pc-cygwin/bin/ld: libdriver.a(regexp.o) (15065208): Section flag STYP_COPY (0x10) ignored Program received signal SIGSEGV, Segmentation fault. _bfd_coff_get_external_symbols (abfd=abfd AT entry=0x6005374e0) at /usr/src/debug/binutils-2.28-3/bfd/coffgen.c:1635 1635 if (obj_coff_external_syms (abfd) != NULL) (gdb) bt #0 _bfd_coff_get_external_symbols (abfd=abfd AT entry=0x6005374e0) at /usr/src/debug/binutils-2.28-3/bfd/coffgen.c:1635 #1 0x000000010045382e in coff_link_add_object_symbols (abfd=0x6005374e0, info=0x100571c00 ) at /usr/src/debug/binutils-2.28-3/bfd/cofflink.c:183 #2 0x000000010045433e in coff_link_check_archive_element (abfd=0x6005374e0, info=0x100571c00 , h=, name=, pneeded=0xffffc11c) at /usr/src/debug/binutils-2.28-3/bfd/cofflink.c:220 #3 0x000000010043c095 in _bfd_generic_link_add_archive_symbols (abfd=0x6000ba0e0, info=0x100571c00 , checkfn=0x1004542e0 ) at /usr/src/debug/binutils-2.28-3/bfd/linker.c:977 #4 0x000000010040edb8 in load_symbols (entry=0x60003a200, place=) at /usr/src/debug/binutils-2.28-3/ld/ldlang.c:2863 #5 0x000000010040f8d0 in open_input_bfds (s=0x60003a200, mode=mode AT entry=OPEN_BFD_NORMAL) at /usr/src/debug/binutils-2.28-3/ld/ldlang.c:3312 #6 0x0000000100411976 in lang_process () at /usr/src/debug/binutils-2.28-3/ld/ldlang.c:7010 #7 0x00000001004e8c7a in main (argc=69, argv=0xffffc450) at /usr/src/debug/binutils-2.28-3/ld/ldmain.c:437 (gdb) print *abfd $1 = {filename = 0x600537640 "regexp.o (symbol from plugin)", xvec = 0x10053f140 , iostream = 0x600537670, iovec = 0x100523360 <_bfd_memory_iovec>, lru_prev = 0x0, lru_next = 0x0, where = 9, mtime = 0, id = 4294967261, format = bfd_unknown, direction = read_direction, flags = 71680, cacheable = 0, target_defaulted = 1, opened_once = 0, mtime_set = 0, no_export = 0, output_has_begun = 0, has_armap = 0, is_thin_archive = 0, selective_search = 0, is_linker_output = 0, is_linker_input = 0, plugin_format = bfd_plugin_unknown, lto_output = 0, plugin_dummy_bfd = 0x0, origin = 0, proxy_origin = 0, section_htab = {table = 0x6005381d0, newfunc = 0x100441630 , memory = 0x600537620, size = 13, count = 0, entsize = 304, frozen = 0}, sections = 0x0, section_last = 0x0, section_count = 0, archive_pass = 0, start_address = 0, outsymbols = 0x0, symcount = 0, dynsymcount = 0, arch_info = 0x100522c00 , arelt_data = 0x0, my_archive = 0x0, archive_next = 0x0, archive_head = 0x0, nested_archives = 0x0, link = {next = 0x0, hash = 0x0}, tdata = {aout_data = 0x0, aout_ar_data = 0x0, oasys_obj_data = 0x0, oasys_ar_data = 0x0, coff_obj_data = 0x0, pe_obj_data = 0x0, xcoff_obj_data = 0x0, ecoff_obj_data = 0x0, ieee_data = 0x0, ieee_ar_data = 0x0, srec_data = 0x0, verilog_data = 0x0, ihex_data = 0x0, tekhex_data = 0x0, elf_obj_data = 0x0, nlm_obj_data = 0x0, bout_data = 0x0, mmo_data = 0x0, sun_core_data = 0x0, sco5_core_data = 0x0, trad_core_data = 0x0, som_data = 0x0, hpux_core_data = 0x0, hppabsd_core_data = 0x0, sgi_core_data = 0x0, lynx_core_data = 0x0, osf_core_data = 0x0, cisco_core_data = 0x0, versados_data = 0x0, netbsd_core_data = 0x0, mach_o_data = 0x0, mach_o_fat_data = 0x0, plugin_data = 0x0, pef_data = 0x0, pef_xlib_data = 0x0, sym_data = 0x0, any = 0x0}, usrdata = 0x60053c710, memory = 0x600537600, build_id = 0x0} On Wed, Sep 27, 2017 at 6:51 AM, 叶雨飞 wrote: > The same program was linking fine using previous gcc 5.X , please > advise how to debug further. > > [Linking driver.exe] > collect2: fatal error: ld terminated with signal 11 [Segmentation > fault], core dumped > compilation terminated. > /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: > libdriver.a(regexp.o) (15065197): Section flag STYP_GROUP (0x4) > ignored > /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: > libdriver.a(regexp.o) (15065197): Section flag STYP_COPY (0x10) > ignored > make: *** [Makefile:194: driver.exe] Error 1 > > aunyx AT DESKTOP-R60LL3E ~/fluffos/src > $ cat ld.exe.stackdump > Exception: STATUS_ACCESS_VIOLATION at rip=0010045A417 > rax=0000000000000000 rbx=0000000600525E40 rcx=0000000600525E40 > rdx=0000000100571C00 rsi=0000000000000001 rdi=00000006002E2420 > r8 =0000000600528C70 r9 =0000000000000058 r10=0000000100000000 > r11=0000000000000000 r12=00000000000003EE r13=0000000100571C00 > r14=00000006000D5B50 r15=00000006000CDC00 > rbp=00000006000D9A30 rsp=00000000FFFFC4D0 > program=D:\cygwin\usr\x86_64-pc-cygwin\bin\ld.exe, pid 8564, thread main > cs=0033 ds=002B es=002B fs=0053 gs=002B ss=002B > Stack trace: > Frame Function Args > 006000D9A30 0010045A417 (00100571C00, 006000E3374, 000FFFFC6A0, 00100571C00) > 006000D9A30 0010045382E (006002E2420, 006000D9A30, 000000003EE, 00100571C00) > 006000D9A30 0010045433E (001004EAE20, 00000000000, 0010042843B, 000FFFFC70C) > 006000D9A30 0010043C095 (00100571C00, 001004542E0, 001800BAE1C, 00000000000) > 00000000000 0010040EDB8 (00600075530, 00600076970, 0010050295C, 00000000000) > 00000000000 0010040F8D0 (001802FDC50, 00600068A50, 001800BB092, 00600069690) > 000FFFFCA40 00100411976 (003FED791C0, 006000003F0, 001800BB092, 00000390038) > 000FFFFCA40 001004E8C7A (000FFFFCA40, 000FFFFCAF0, 00000000000, 001801C31A0) > 000FFFFCCB0 00180047BC2 (00000000000, 00000000000, 00000000000, 00000000000) > 00000000000 00180045863 (00000000000, 00000000000, 00000000000, 00000000000) > 000FFFFFFF0 00180045914 (00000000000, 00000000000, 00000000000, 00000000000) > End of stack trace -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple