From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by sourceware.org (Postfix) with ESMTPS id 1EDD6386F02B for ; Wed, 22 Apr 2020 02:21:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1EDD6386F02B Received: by mail-pj1-x1042.google.com with SMTP id mq3so216028pjb.1 for ; Tue, 21 Apr 2020 19:21:16 -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:user-agent; bh=dewkK32V7fSW9bCEVKiKCpvawzX/uGYWJTvZDboEdKk=; b=cawGOkbOo+79WCji9S5SaTVJ+qU3Zxg3vVR9xNDFqDlDtvaMdNHadJftDfuZ/HIOiH rc8JF66xledHeytsFlYKubkP9EgaYAamT8QiQrtIea5wJpiuksZ5OZb9lN6JNQl9z7au NUjsI2oqqkjXn+Im20snhOs1As7i2zluRbXO6Hdvx7iwC+xDaNpszegkG4pd6cSl/VNF rxGaXGA08d8lllGSSv50QUCp3q2Kwnf9Dmd6ffczxxtj94Fgffr0KGEp58lEEznSInnR 1hMQOZJ3wAwJEglxE5g0P72oykDh/1+y6CPOffwDJ6rwqhL/rqzevaQsAtjeEEukwMfH Ot7g== X-Gm-Message-State: AGi0PuaY8UtcN528dgDxD32soyaZY/SSix3kvvlJmiw7tyAnzYzuxF04 zMO+f6uA/J9RAqRvQquf1QQ= X-Google-Smtp-Source: APiQypLalRr2Dap3EuBAYKJkfnT9Fm2l2bZ2XBr+56YBxanYJzLw0DKZIvzMwBI1iFvr4ZMkyekbsQ== X-Received: by 2002:a17:902:7614:: with SMTP id k20mr4956028pll.324.1587522075270; Tue, 21 Apr 2020 19:21:15 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:29af:bd19:75db:820c]) by smtp.gmail.com with ESMTPSA id na8sm595084pjb.48.2020.04.21.19.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 19:21:14 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id AC0BF80856; Wed, 22 Apr 2020 11:51:10 +0930 (ACST) Date: Wed, 22 Apr 2020 11:51:10 +0930 From: Alan Modra To: "H.J. Lu" Cc: Binutils Subject: Re: PING: V4 [PATCH] gas: Extend .symver directive Message-ID: <20200422022110.GH20514@bubble.grove.modra.org> References: <20200407235842.bpsbiifriyff42td@gmail.com> <20200409171656.5wxp43yuaqzweovx@gmail.com> <817a830e-69c9-7b7f-b0c0-9effa2e8b8a5@redhat.com> <20200421235220.GG20514@bubble.grove.modra.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-23.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, 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: Wed, 22 Apr 2020 02:21:17 -0000 On Tue, Apr 21, 2020 at 06:19:45PM -0700, H.J. Lu wrote: > On Tue, Apr 21, 2020 at 4:52 PM Alan Modra wrote: > > > > On Wed, Apr 22, 2020 at 08:50:06AM +0930, Alan Modra wrote: > > > avr-elf +FAIL: symver symver11 > > > d10v-elf +FAIL: symver symver11 > > > dlx-elf +FAIL: symver symver11 > > > ip2k-elf +FAIL: symver symver11 > > > m68k-elf +FAIL: symver symver11 > > > mcore-elf +FAIL: symver symver11 > > > msp430-elf +FAIL: symver symver7 > > > pj-elf +FAIL: symver symver11 > > > s12z-elf +FAIL: symver symver11 > > > shle-unknown-netbsdelf +FAIL: symver symver11 > > > sh-linux +FAIL: symver symver11 > > I am checking in this for sh targets: > > diff --git a/gas/testsuite/gas/symver/symver11.s > b/gas/testsuite/gas/symver/symver11.s > index 547e8123f0..08416be0f0 100644 > --- a/gas/testsuite/gas/symver/symver11.s > +++ b/gas/testsuite/gas/symver/symver11.s > @@ -6,4 +6,5 @@ foo: > .size foo,.-foo > .symver foo,foo@@version2,remove > .symver foo,foo@version1 > + .balign 8 > .dc.a foo Sure. The msp430 symver7 fix is easy too. Allow other random symbols between the ones you check. > > > sh-nto +FAIL: symver symver11 > > > sh-rtems +FAIL: symver symver11 > > > visium-elf +FAIL: symver symver11 > > > xc16x-elf +FAIL: symver symver11 > > > z80-elf +FAIL: symver symver11 > > > > All of the symver11 fails except the sh ones are due to the symbol > > actually being removed! As it is supposed to be, if not used in a > > relocation. And those targets happen to reduce the reference to foo > > down to a section symbol. > > foo is a global symbol. Should assembler not reduce its reference > to a section symbol? If these targets have to do it, I can skip this test > for these targets. > > > I wonder if ".symver intsym, extsym@@nodename, remove" ought to really > > remove the symbol resulting in an assembly error if referenced? > > > > A testcase? I mean this: diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index 409ea4d6be..4bdddc9056 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -2569,9 +2569,7 @@ elf_frob_symbol (symbolS *symp, int *puntp) elfsym->internal_elf_sym.st_other |= STV_HIDDEN; break; case visibility_remove: - /* Remove the symbol if it isn't used in relocation. */ - if (!symbol_used_in_reloc_p (symp)) - symbol_remove (symp, &symbol_rootP, &symbol_lastP); + symbol_remove (symp, &symbol_rootP, &symbol_lastP); break; case visibility_local: S_CLEAR_EXTERNAL (symp); And then your symver11 testcase fails on x64 with symver11.s:9: Error: redefined symbol cannot be used on reloc Of course on the other targets that reduce the foo reference to .data you won't get an error. One way to make those targets behave the same would be to make foo weak. -- Alan Modra Australia Development Lab, IBM