From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id 8F96E3858C5E for ; Wed, 16 Aug 2023 23:55:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F96E3858C5E 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-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-26b41d5e440so2555444a91.2 for ; Wed, 16 Aug 2023 16:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692230113; x=1692834913; 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=luyMnqmuB85gWWOCixvTvf6B1NcjR0JyHnrueraeano=; b=kq932qERzgZnn/H6bh1N1spShWPL9IcW2btbWjfiFdzCFgK2qkd/OeF5oOswbE07Xz aAez0CNyUfXvBu8m66R2wqddwg5Z7LSu5fVoWPjh662PV7lXXC04Tm4R7dmd95Kw0iHc MNI+n8WF7mpwJafgdBkG3iuzIXei83oKAkEvZ1ijlcgt49HJjZPpuWScJ4/gWpLny5SU IC8DD9FgplORr+5JryK7dfrSDswe7hwGE9AjKpyICxK6vfjSx7u6YzDuUH74WTi2yoMg VGuYwMEVptjUuqtyqtDW1Qg7ROX+Lc7UOqu7uzq8Pen0k/UUgV7Mh6aeHZEN4C3zQA2S sOTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692230113; x=1692834913; 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=luyMnqmuB85gWWOCixvTvf6B1NcjR0JyHnrueraeano=; b=SODgeHZCUXv7yAzjOPhFH5iQ596qC44ykNgZi1cZghhPbmVTOYlQhdD6Gq4PebVm+i VWKAGXuoTHcSiG3Bbbawa2OQL3ZQ0XEbt3xqSZO59nrErvar/sVIZ/Nwb3LActXpbapN tA3WJmnFDpeMUx57a7AfPHfcVWfwYIvzYVkK7+wcuFaOWIRNS/PX40Vg0PXeKm8UQ9EJ vgTWrcExNSPov083cYss+eFnhDQ0VKcCrb/7qM5E3AauPf0R/HQ4QAk6djo4zzLoIpj7 a+IkznyLeNnntESDemOYbB/usgv6riYZSQxR0le5gzxlCRtWcLEhucE2yRVeDpUwrV13 nqRw== X-Gm-Message-State: AOJu0YycDU+f5KsAtZJxLasF49tmetdmxKM0yTUkjOqD9R6ywmvxADeR 3wbcdkKtwlEJC8Pqdb4TAlFhG5X/Bo0= X-Google-Smtp-Source: AGHT+IHTffbJmp0iAh+6+xUgQS9LxQuDbyavxv9udyvHwUh3YZyM9dLdbl/Bei1niolQWvrZhJLl0w== X-Received: by 2002:a17:90b:4c4f:b0:261:688:fd91 with SMTP id np15-20020a17090b4c4f00b002610688fd91mr2902187pjb.8.1692230112966; Wed, 16 Aug 2023 16:55:12 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:2d88:466e:f1cc:722]) by smtp.gmail.com with ESMTPSA id 18-20020a17090a001200b0026b12768e46sm315536pja.42.2023.08.16.16.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 16:55:03 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 0F558114044A; Thu, 17 Aug 2023 09:24:58 +0930 (ACST) Date: Thu, 17 Aug 2023 09:24:58 +0930 From: Alan Modra To: Jan Beulich Cc: Binutils Subject: Re: [PATCH] gas: make S_IS_LOCAL() and S_IS_EXTERNAL() exclusive of one another Message-ID: References: <3d540eef-9167-1559-9414-111e6c23498d@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3d540eef-9167-1559-9414-111e6c23498d@suse.com> X-Spam-Status: No, score=-3026.3 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.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, Aug 11, 2023 at 10:07:50AM +0200, Jan Beulich via Binutils wrote: > While they aren't opposites of each other, there also shouldn't be any > symbol for which both return true; both may return false. Therefore > use S_IS_EXTERNAL() in S_IS_LOCAL(), thus subsuming the sanity check > which so far both did alike. Yes, I agree that S_IS_EXTERNAL and S_IS_LOCAL should not both return true, and it's good to enforce that here. > --- a/gas/symbols.c > +++ b/gas/symbols.c > @@ -2420,15 +2420,14 @@ S_IS_LOCAL (symbolS *s) > if (s->flags.local_symbol) > return 1; > > - flags = s->bsym->flags; > - > - /* Sanity check. */ > - if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL)) > - abort (); > + if (S_IS_EXTERNAL (s)) > + return 0; > > if (bfd_asymbol_section (s->bsym) == reg_section) > return 1; > > + flags = s->bsym->flags; > + > if (flag_strip_local_absolute > /* Keep BSF_FILE symbols in order to allow debuggers to identify > the source file even when the object file is stripped. */ -- Alan Modra Australia Development Lab, IBM