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 CB2A1385E003 for ; Wed, 25 Mar 2020 22:53:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CB2A1385E003 Received: by mail-pl1-x634.google.com with SMTP id x1so1395756plm.4 for ; Wed, 25 Mar 2020 15:53:34 -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=4yEu5fxYxIUOqUNgf9jz1YQxAEmoHd1oJboPuOI7g9Q=; b=ICnKitPCXMmPoHoX8ip/A1l5YS/hGiliXFzFtfh6/FWXz6qV9E0xUZncC+0Uym2iWR Cyfi61LphHhAofB0bOZnJVR7BL89yqmOugpNauNEiNgOamyZiJAXMKeheBY2A/9snO63 ta4JPDV1lisi74FP1Y0F8xDFo/btsrZIJzkdwZql3xYpqvzvrIhT0ymRMx93RXlRQu+p ZNtp8SAj4AoGxKzKYQihuZbMwZkm1Ez1KN0hwa2Q4A9XgZhu4YBo08+ymLw5UBOvdnGH RQBQbCAmAgn8OlrdLrULCihYWofRTxlN53XriIC6b5rURJojQCBgu+Mh6UkCmMHDTLEv B0UQ== X-Gm-Message-State: ANhLgQ3yHvNJ1TkYshnZRD8eD6XTHf9vRVcPcQ0HbvjmwUdCrkDiD65t 1KoHQiS+WrorjJbQVt7OOkQ= X-Google-Smtp-Source: ADFU+vsYqD/8jFleteE3+y6kLyvMjtaKafTm412njANjbIMWdCnkJjNqSqUOP7Zmp9FVnXf2y+d7eQ== X-Received: by 2002:a17:902:9348:: with SMTP id g8mr5408453plp.112.1585176813433; Wed, 25 Mar 2020 15:53:33 -0700 (PDT) Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:b4e4:c6d8:e68c:70f7]) by smtp.gmail.com with ESMTPSA id g12sm148853pfo.200.2020.03.25.15.53.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Mar 2020 15:53:32 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 20042806BF; Thu, 26 Mar 2020 09:23:29 +1030 (ACDT) Date: Thu, 26 Mar 2020 09:23:29 +1030 From: Alan Modra To: Fangrui Song Cc: binutils@sourceware.org Subject: Re: Error for the second binding (.local/.weak/.globl) Message-ID: <20200325225328.GH4583@bubble.grove.modra.org> References: <20200325053601.w6vxbh5ignc6bt65@gmail.com> <20200325084140.GF4583@bubble.grove.modra.org> <20200325214622.kj3v3habvpgchtyv@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200325214622.kj3v3habvpgchtyv@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-8.2 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: Wed, 25 Mar 2020 22:53:36 -0000 On Wed, Mar 25, 2020 at 02:46:22PM -0700, Fangrui Song wrote: > On 2020-03-25, Alan Modra wrote: > > On Tue, Mar 24, 2020 at 10:36:01PM -0700, Fangrui Song wrote: > > > .weak (config/obj-elf.c) apparently overrides .globl (read.c) and .local > > > (config/obj-elf.c) but this seems accidental rather than intentional. > > > > No, it was deliberate. git commit 5ca547dc239. > > Ian does not remember what problems the commit fixed. He wouldn't have > done it on a whim. gas emitted an error prior to that patch. Quite likely it was due to gcc at that time emitting both .global and .weak, or .local and .weak, under some condition. > Maybe we can revisit the decision after 24 years. I think it is completely fine for you to make the llvm assembler error on inconsistent binding, or the last directive win. Either of those behaviours is logical and good, but you quite possibly will run into a need to fix more user assembly. I also think it OK to leave gas as is, given that we have been that way for many years without complaint, but I won't object if one of the other global maintainers thinks we should change. -- Alan Modra Australia Development Lab, IBM