From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by sourceware.org (Postfix) with ESMTPS id E89C838618AD for ; Mon, 21 Jun 2021 02:16:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E89C838618AD Received: by mail-pj1-x1031.google.com with SMTP id s17-20020a17090a8811b029016e89654f93so11646578pjn.1 for ; Sun, 20 Jun 2021 19:16:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CaJygdGaSpTNdXk2nd0S6cSvoTs7nbZiNSc7J1TPHzg=; b=U1tbt3LHlwZ5PuowWHQ+sQ1xsTzzBgk8k4tczmr4BAKX5A7eEl1KHvbNgH+h1Sg5ks pZM3dmhNwK+yWRR8+EyJlTbDfUpOzUudvo8ZYL/aLtccP7NZs0DgIrmSEZBTrgSz1V0y xqdbNTBY20ZtzfVE901Zf+bu98kPJmES0CqXXD3Ssxc3vBgpDTCSXa5qQkDK6QjWrb9I 1RkCvIQ7jYPVM9jHjODc5KH+lhqJJKTqyhvjoIYe1C6xv6kuEdzcGArkpunGgI5xgp8g p/tmwWDCAOSRiLNMWC1nyBwLeA0qzx/wyLcDdS/JkXZQmUJTLLEW94kjoEtTWNZMcum8 ctBg== X-Gm-Message-State: AOAM532yhJPvfjWtw6F7Xnir5uQNhcxD7ELSQqwtunLhZBKu2B8SR3oL OHxaFlGeZckT00tE1BlUXT3CbfNnv45vOw== X-Google-Smtp-Source: ABdhPJyy5IJ+ag7/00lcM5LKlbIAWIWA+Eu5/w4/RxNY8JX2NMbQDaBU3pG1HigohDNAlNH3RWzlUw== X-Received: by 2002:a17:902:aa4a:b029:10e:f98c:2b83 with SMTP id c10-20020a170902aa4ab029010ef98c2b83mr15637965plr.62.1624241814005; Sun, 20 Jun 2021 19:16:54 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:2f51:fb73:3acc:8f0]) by smtp.gmail.com with ESMTPSA id t2sm11067552pjj.19.2021.06.20.19.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Jun 2021 19:16:53 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 65B4B11434F3; Mon, 21 Jun 2021 11:46:50 +0930 (ACST) Date: Mon, 21 Jun 2021 11:46:50 +0930 From: Alan Modra To: "H.J. Lu" Cc: binutils@sourceware.org Subject: Re: [PATCH 2/2] elf: Add GNU_PROPERTY_1_NEEDED check Message-ID: References: <20210620225029.390239-1-hjl.tools@gmail.com> <20210620225029.390239-3-hjl.tools@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210620225029.390239-3-hjl.tools@gmail.com> X-Spam-Status: No, score=-3031.0 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 autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2021 02:16:56 -0000 On Sun, Jun 20, 2021 at 03:50:29PM -0700, H.J. Lu via Binutils wrote: > --- a/bfd/elflink.c > +++ b/bfd/elflink.c > @@ -3331,6 +3331,10 @@ _bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, > if (!is_elf_hash_table (&hash_table->root)) > return true; > > + /* STV_PROTECTED symbols with single global definition are local. */ > + if (info->single_global_definition > 0) > + return true; > + > bed = get_elf_backend_data (hash_table->dynobj); > > /* If extern_protected_data is false, STV_PROTECTED non-function With single_global_definition set you will require access from an executable to a protected visibility symbol defined in a shared library to go through the GOT, and you won't be using dynbss copies. How can it be correct for symbol_refs_local_p to return true here for such an executable reference? It seems logically incorrect, since such an access is clearly not local. -- Alan Modra Australia Development Lab, IBM