From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by sourceware.org (Postfix) with ESMTPS id EBA683858C33 for ; Thu, 20 Jul 2023 09:05:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EBA683858C33 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-x634.google.com with SMTP id d9443c01a7336-1bb119be881so3863765ad.3 for ; Thu, 20 Jul 2023 02:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689843934; x=1690448734; 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=GkGQ5hYkg+j5xMXuttbpglnAPTKdhcAlIikZsvKDQG4=; b=MvAOTwgVaDX3OAlnsC91q2A6MWSGU3yGvTDvKQim6BedYPsYVBmB1jbELoSLDSBqWz Ttk01FgBwrD4r27tWp/VPUSqBSNl08hEPxXCldjI3gORmkVKQ6tNdecHT6F77FXRtrhk eqR5h5IXbeRhDtbFbvcnw8E7TSZzUUC7WoZqnj4Fk1tKlRPNNaZaJYbT7pFEZxXsl2BW TsNNrrhnhOTH4pXKe/ll+T8UU6VWFY7ARzPnfNNNbUkoDH+qX7ECa2k50SL1D3QtM03R dCgSedtxvimMKvOVGIqZL0a7t7dEBORvKyp6jqFlE02LuCEgtwBvy+EQsgu5Ir90ICF1 wt8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689843934; x=1690448734; 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=GkGQ5hYkg+j5xMXuttbpglnAPTKdhcAlIikZsvKDQG4=; b=aKEZjulnprXDj0pGmZPLYWg+FfnIL2NSGq8DCwrEGUqjj8C4f5XNZH0Za9KKO2SHRH zs8o1l3FOWi9D/ADIsizv0pb7WrpeRz2krXoy8rfXU1GQ9WMo68tUO1m1b2Hd/mVvpH4 uHvClSweFchquXhsZ86F+Vt0KkaaZ5FPIvVJVJztb1Fn5I5sS+SNeXvLAU5Mh8Pj8F3u NIcL9MSXVZ3d+98k754s9FUGxcGToXeFmy89UBQyNdeNR92bWPIil2J3s9Y6Gga/8P/u vEzUplp+xnpMPl72WHc+8k/EfqSJ9l22t98fX5Qn+kxYW7be8Bby2+lwR5RO23GRxoz3 wgrg== X-Gm-Message-State: ABy/qLbTL2uroIkucBLi0hKKjY4+iMMZxb+6Ytw2xyYegSCMo2rCpbD7 T6vbAHRqQoMsxF1iwscAk+M= X-Google-Smtp-Source: APBJJlHYqvQAjgsnIwrJJIzatJB9eJrUfiewHd/ZVFbYWilyT+jfpYlmwQcjyCyu3R7h7IVz7j8W5g== X-Received: by 2002:a17:903:1109:b0:1b8:560a:aa16 with SMTP id n9-20020a170903110900b001b8560aaa16mr1924806plh.10.1689843934132; Thu, 20 Jul 2023 02:05:34 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:4d08:cebd:d73f:b794]) by smtp.gmail.com with ESMTPSA id k6-20020a170902ba8600b001ae5d21f760sm762471pls.146.2023.07.20.02.05.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 02:05:32 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 0F5231142B6C; Thu, 20 Jul 2023 18:35:30 +0930 (ACST) Date: Thu, 20 Jul 2023 18:35:30 +0930 From: Alan Modra To: YunQiang Su Cc: "Maciej W. Rozycki" , YunQiang Su , binutils@sourceware.org, Nick Clifton Subject: Re: [PATCH v2] MIPS: Don't move __gnu_lto_slim to .scommon Message-ID: References: <20230703103647.3162351-1-yunqiang.su@cipunited.com> <20230703105034.3163572-1-yunqiang.su@cipunited.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3033.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,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: I think the patch is OK, but the same should be applied to another place to stop objcopy modifying __gnu_lto_slim. mips-linux-gnu testcase after running make check: binutils/objcopy ld/tmpdir/pr15323a-r.o ld/tmpdir/xxx then inspect ld/tmpdir/xxx with readelf. I'm going to apply the following to mainline, and will also apply to the 2.41 branch tomorrow if no one objects. * elfxx-mips.c (_bfd_mips_elf_symbol_processing): Don't treat __gnu_lto_slim as SHN_MIPS_SCOMMON. (_bfd_mips_elf_add_symbol_hook): Likewise. diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 71f2dc9d779..1e9851c3190 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -7176,10 +7176,11 @@ _bfd_mips_elf_symbol_processing (bfd *abfd, asymbol *asym) case SHN_COMMON: /* Common symbols less than the GP size are automatically - treated as SHN_MIPS_SCOMMON symbols on IRIX5. */ + treated as SHN_MIPS_SCOMMON symbols, with some exceptions. */ if (asym->value > elf_gp_size (abfd) || ELF_ST_TYPE (elfsym->internal_elf_sym.st_info) == STT_TLS - || IRIX_COMPAT (abfd) == ict_irix6) + || IRIX_COMPAT (abfd) == ict_irix6 + || strcmp (asym->name, "__gnu_lto_slim") == 0) break; /* Fall through. */ case SHN_MIPS_SCOMMON: @@ -7862,10 +7863,11 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info, { case SHN_COMMON: /* Common symbols less than the GP size are automatically - treated as SHN_MIPS_SCOMMON symbols. */ + treated as SHN_MIPS_SCOMMON symbols, with some exceptions. */ if (sym->st_size > elf_gp_size (abfd) || ELF_ST_TYPE (sym->st_info) == STT_TLS - || IRIX_COMPAT (abfd) == ict_irix6) + || IRIX_COMPAT (abfd) == ict_irix6 + || strcmp (*namep, "__gnu_lto_slim") == 0) break; /* Fall through. */ case SHN_MIPS_SCOMMON: -- Alan Modra Australia Development Lab, IBM