From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 772493858D28 for ; Tue, 1 Aug 2023 22:22:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 772493858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-1bbbbb77b38so37183285ad.3 for ; Tue, 01 Aug 2023 15:22:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690928536; x=1691533336; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/LgAteCd93VSzU7sCyjbfzZRebCQkPmx/lTbyoOB2Z4=; b=Jo+N7ITPk/AAqTibHYLD6u5U9MYz21eL4VNPzZP8RYurV7t+7aUhanDAEjOHAaFZHN D8MR5NCOUklHl9hlPLkQleyuCkbzwCwbnYf79iuFvmXp93AS5Tx4wQESSFHmNc8dL38e lZa8OiHTcsKo6N7+gpPPnkYFy40qTcDi6Ho1PqB1pMbmABox8U4eoAVHMDcsrESmt8et v53ve9RCCS3x7FUvJlIlj5mjhpZflKyaTEY1Tl+W8UuTjaoSjtO8uAs9O9jVfhT/bZfn heAgq7yrLv+bIBO9W8M7dB/kzJ1+jJ1rm5AV9TH397F22LvfGSKfn/0pOyS+qg/0g7je YoDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690928536; x=1691533336; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/LgAteCd93VSzU7sCyjbfzZRebCQkPmx/lTbyoOB2Z4=; b=Mp+hAtUxFtNJaL3d9MD2eSsJizTQwEhQwXruTA2TJPphBl1hMpj2NSCKx8yGmXHVMs 5yyRZMMt5lcj/9Of5gmBn7kwYsSBkj3w8D4ONS7m1/zkWXfLGuHjuCDLp7GhEG2SsG4U 9k8OD7xeDDXAM0J6MS7wBreLBygXZvRsagnzoU7UODyZTrrFBKfL8U/bRrg/AT+c+WcD yeJ6r8MA3Fha8xZNpuKI//GTbmPaTT0C1NcKk8eAVacewmaIkpk4j+dBn1SJM82KjxFr 35g7PAyNI8QBWKMc52ReTTyA+Tpuq2LU1LwFoFvsdvlXcLUeodNU1NO2EULo+997RKhr bHXQ== X-Gm-Message-State: ABy/qLZs37z3XAZ2zwTFY4pEUbGoY/ZTQ5p1+6FNnAam4zehLP3Vg+52 R+JD61Ohspb8qBTkWvjyKDw= X-Google-Smtp-Source: APBJJlFlDacpqA/hb0lDIJofTH7/Cais99MKUvJIvDATYVKNCbyY/UBZOW+TjGSjIvPPoPSq9/87LA== X-Received: by 2002:a17:902:c10c:b0:1b9:ce10:b50a with SMTP id 12-20020a170902c10c00b001b9ce10b50amr12079676pli.4.1690928536192; Tue, 01 Aug 2023 15:22:16 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:882:7df9:9cf2:59e4]) by smtp.gmail.com with ESMTPSA id n3-20020a170902e54300b001b9c960ffeasm10974448plf.47.2023.08.01.15.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Aug 2023 15:22:15 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 0C62F11403B1; Wed, 2 Aug 2023 07:52:13 +0930 (ACST) Date: Wed, 2 Aug 2023 07:52:13 +0930 From: Alan Modra To: Oleg Tolmatcev Cc: Nick Clifton , "binutils@sourceware.org" Subject: Re: [PATCH V3] optimize handle_COMDAT Message-ID: References: <648f4180.a70a0220.a7021.407c@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3026.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Aug 01, 2023 at 10:41:55AM +0930, Alan Modra wrote: > On Mon, Jul 03, 2023 at 12:09:22AM +0200, Oleg Tolmatcev via Binutils wrote: > > Am Fr., 30. Juni 2023 um 14:08 Uhr schrieb Nick Clifton : > > > Thank you. Unfortunately there are still a couple of problems > > > with the patch, Firstly, and most importantly, the patch triggers > > > a new failure in the linker testsuite: > > > > > > Running ld/testsuite/ld-linkonce/linkonce.exp ... > > > [...] > > > FAIL: pr26103 > > > > > > > I have run "make check" in WSL and it passed. I then rebased the patch > > on top of master and ran "make check" in WSL again and it passed. I > > can not reproduce the failure. I develop on Windows, but I even ran it > > on my Linux machine with Manjaro Linux and it passed. > > I applied your latest patch, and it results in failures as Nick said. > > aarch64-pe +FAIL: pr26103 > arm-pe +FAIL: pr26103 > arm-wince-pe +FAIL: pr26103 > i686-pe +FAIL: pr26103 > mcore-pe +FAIL: pr26103 > sh-pe +FAIL: pr26103 > x86_64-w64-mingw32 +FAIL: pr26103 > > This is with mainline binutils built on x86_64-linux using > ~/src/binutils-gdb/configure \ > --disable-nls \ > --disable-gdb --disable-gdbserver --disable-gdbsupport --disable-gprofng \ > --disable-libbacktrace --disable-libdecnumber --disable-readline --disable-sim \ > --enable-obsolete --target=$target > make && make check > > I think something is wrong with your testing. In ld/ld.log for > x86_64-w64-mingw32 I see > > ./ld-new -o tmpdir/pr26103 -L/home/alan/src/binutils-gdb/ld/testsuite/ld-linkonce tmpdir/ref1.o --start-group tmpdir/sym.a tmpdir/ref2.o --end-group > Executing on host: sh -c {./ld-new -o tmpdir/pr26103 -L/home/alan/src/binutils-gdb/ld/testsuite/ld-linkonce tmpdir/ref1.o --start-group tmpdir/sym.a tmpdir/ref2.o --end-group 2>&1} /dev/null ld.tmp (timeout = 300) > spawn [open ...] > ./ld-new: tmpdir/sym.a(sym2.o):fake:(.gnu.linkonce.d.foo[onex]+0x0): multiple definition of `foo'; tmpdir/sym.a(sym1.o):fake:(.gnu.linkonce.d.foo[one]+0x0): first defined here > ./ld-new: tmpdir/sym.a(sym3.o):fake:(.gnu.linkonce.d.foo[oney]+0x0): multiple definition of `foo'; tmpdir/sym.a(sym1.o):fake:(.gnu.linkonce.d.foo[one]+0x0): first defined here > ./ld-new: tmpdir/sym.a(sym2.o):fake:(.gnu.linkonce.d.foo[onex]+0x0): multiple definition of `foo'; tmpdir/sym.a(sym1.o):fake:(.gnu.linkonce.d.foo[one]+0x0): first defined here > ./ld-new: tmpdir/sym.a(sym3.o):fake:(.gnu.linkonce.d.foo[oney]+0x0): multiple definition of `foo'; tmpdir/sym.a(sym1.o):fake:(.gnu.linkonce.d.foo[one]+0x0): first defined here > FAIL: pr26103 There is also this with a -fsanitize=address,undefined build. Executing on host: sh -c {/home/alan/build/gas-san32/x86_64-w64-mingw32/ld/../binutils/ar rc tmpdir/sym.a tmpdir/sym1.o tmpdir/sym2.o tmpdir/sym3.o tmpdir/ref2.o 2>&1} /dev/null ld.tmp (timeout = 300) spawn [open ...] ================================================================= ==3449699==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf43036ea at pc 0x569046d2 bp 0xffff86c8 sp 0xffff86b8 READ of size 1 at 0xf43036ea thread T0 #0 0x569046d1 in bfd_getl32 /home/alan/src/binutils-gdb/bfd/libbfd.c:838 #1 0x56975f86 in _bfd_pex64i_swap_aux_in /home/alan/build/gas-san32/x86_64-w64-mingw32/bfd/peXXigen.c:319 #2 0x5695fe88 in fill_comdat_hash /home/alan/src/binutils-gdb/bfd/coffcode.h:943 #3 0x5695fe88 in handle_COMDAT /home/alan/src/binutils-gdb/bfd/coffcode.h:1090 #4 0x5695fe88 in styp_to_sec_flags /home/alan/src/binutils-gdb/bfd/coffcode.h:1299 #5 0x569ec52c in make_a_section_from_file /home/alan/src/binutils-gdb/bfd/coffgen.c:210 #6 0x569ec52c in coff_real_object_p /home/alan/src/binutils-gdb/bfd/coffgen.c:368 #7 0x569ee70a in coff_object_p /home/alan/src/binutils-gdb/bfd/coffgen.c:446 #8 0x568f91c9 in bfd_check_format_matches /home/alan/src/binutils-gdb/bfd/format.c:431 #9 0x568fc611 in bfd_check_format /home/alan/src/binutils-gdb/bfd/format.c:94 #10 0x568dd80c in _bfd_write_archive_contents /home/alan/src/binutils-gdb/bfd/archive.c:2180 #11 0x5690cebb in bfd_close /home/alan/src/binutils-gdb/bfd/opncls.c:892 #12 0x568c0723 in write_archive /home/alan/src/binutils-gdb/binutils/ar.c:1288 #13 0x568b0038 in replace_members /home/alan/src/binutils-gdb/binutils/ar.c:1550 #14 0x568b0038 in main /home/alan/src/binutils-gdb/binutils/ar.c:936 -- Alan Modra Australia Development Lab, IBM