From patchwork Fri Feb 10 07:40:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 55284 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp812277wrn; Thu, 9 Feb 2023 23:40:45 -0800 (PST) X-Google-Smtp-Source: AK7set9xtRy2Id8NLKom1JSX8vif5V3p0h+enXXCD2S7L2ARWVdQGJ4wVBW/EpqSoIuAUnyJ+AUb X-Received: by 2002:a17:906:584:b0:888:6294:a1fa with SMTP id 4-20020a170906058400b008886294a1famr14630064ejn.14.1676014845466; Thu, 09 Feb 2023 23:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676014845; cv=none; d=google.com; s=arc-20160816; b=ma3JvlCq0TwY944nBsNPLpFIPAYbfJiinPOeR3eVB6fHMa0+jkA/Ax2jV2HpjU4auM cepS6oTYOGK7547236lKZcnnnwM4pBi0aaDyCHB6MQJtDLZdMEPzpfKPTqwRvUi0Wilj Q6fraKrFHefC6YOEKrIr0JGD+az/+MK6Xtf+0DIq2exHlAfK3nOBmETOwfm7/brJ+qri GCiISWoZk7XcrZYKKeyQMiFfBQpd4bbLvbMw+iKdjbuUe3GulAohYAa1zMT6QzafQ9NF JXKgswK5ZlFW5mKU4eIH/fuY4/mnNxb0vbwfK5f0HFAOlHYUbcDUqy6mcZr02+Cp+mns Q0Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-disposition:mime-version:message-id:subject:to:date :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=Ipa2ItHnr3100GUq30JWKx4067+1/lkOqOgTp4S1tKQ=; b=ihtX0WBjhwAfDkagmVSIaqvCYrJdmwCnVsdRM7KdpiXI3Elhdc01WIYd0Cc27dkKy+ cvZMZngTDeA/POcPU14OSjYitl2AHqjewZPy8y6w3KD8MGyPoQbtJp22ZD55VEqL+4ER wLxwtrAAJPwgDSfbU2jaS22FGkENR4vBuDVbKNSGgnClHh9nswq/zV2JZPf8cV2VB7tZ uZlMZVQh8nj2owlP5Qr93TAwkcctN9Uw0l41ofUuoU9x+LdNqcsfCzW+gD+BQCRe0oKt xtVWk2RzM0Ock1HBITjtX7kMH6NAmg75XiFK5QqIdloNewOB1Grab6I9NkEqL4JtKrXT huJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sILCPHJO; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id wi5-20020a170906fd4500b0087861bdac01si4645555ejb.749.2023.02.09.23.40.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 23:40:45 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=sILCPHJO; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2FB3D385840D for ; Fri, 10 Feb 2023 07:40:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FB3D385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676014843; bh=Ipa2ItHnr3100GUq30JWKx4067+1/lkOqOgTp4S1tKQ=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=sILCPHJOsAxQmlEeSxWin+V2jv1yjs/P1VmXa5LLm9Py1qWQv+hchShICLeUJs1L0 CloQ1RGLC2mENcrj9VjSNxS1IkbcxQdwvEO9AW9ZkV6FfoCU2yLkaPonhEsFZikOLU M6yhqnm4lOfC0HwW0uAJ1ng9TuwCr65N0XBpWxFY= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id BD0BB3858C5F for ; Fri, 10 Feb 2023 07:40:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BD0BB3858C5F Received: by mail-pj1-x102a.google.com with SMTP id pj3so4440506pjb.1 for ; Thu, 09 Feb 2023 23:40:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ipa2ItHnr3100GUq30JWKx4067+1/lkOqOgTp4S1tKQ=; b=JtyksLfEKm4YhlA6kx4gQE1gpXdp4cN5ypUW1IZCisSFR8Pjk4a8ABaRAMtdWozYHj jE4IbOjXrS+rnlLNpkb/Nj1v5kIDENma6o1C8CirZnGllAOW2Cid41M3lVrAYtRqJdz+ ZHDE9fGqrV3B9JHbmZcDxWg+dpj7G0GGO9eP0/ydjZ6EABr/0t6cI5PSKOoSzdIXL05I 8+ukbzI30/CLkBeGGCZSjxb1ARHdnLirq7R3xQRkLJzpScQmB2+YqqR5imAurAfXarNc kysN9MITEhbwTiBkWmr6sKPAr7tB8EMoRZjucYl/3zVIBnzhy2LW3DyAvmcHzAhP6WQI lqJg== X-Gm-Message-State: AO0yUKUDBFo1wSq0SMbRWUeWapr4MZ/cgKQdiSKOdqf8E+WlCSZPegpB o/0r9Q3sVvKdgBWDMFz2+DGCsYKzFhw= X-Received: by 2002:a17:902:ee4d:b0:198:dbd8:3cd0 with SMTP id 13-20020a170902ee4d00b00198dbd83cd0mr6936412plo.27.1676014831436; Thu, 09 Feb 2023 23:40:31 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id ij25-20020a170902ab5900b00192a04bc620sm571474plb.295.2023.02.09.23.40.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Feb 2023 23:40:31 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 810231142769; Fri, 10 Feb 2023 18:10:28 +1030 (ACDT) Date: Fri, 10 Feb 2023 18:10:28 +1030 To: binutils@sourceware.org Subject: Local label checks in integer_constant Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-3035.6 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 autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-Patchwork-Original-From: Alan Modra via Binutils From: Alan Modra Reply-To: Alan Modra Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757428942717717169?= X-GMAIL-MSGID: =?utf-8?q?1757428942717717169?= "Local labels are never absolute" says the comment. Except when they are. Testcase .offset 0: a=0b I don't see any particular reason to disallow local labels inside struct definitions, so delete the comment and assertions. * expr.c (integer_constant): Delete local label assertions. diff --git a/gas/expr.c b/gas/expr.c index 189236bec6d..78900b50e46 100644 --- a/gas/expr.c +++ b/gas/expr.c @@ -573,10 +573,6 @@ integer_constant (int radix, expressionS *expressionP) symbolP = symbol_find (name); if ((symbolP != NULL) && (S_IS_DEFINED (symbolP))) { - /* Local labels are never absolute. Don't waste time - checking absoluteness. */ - know (SEG_NORMAL (S_GET_SEGMENT (symbolP))); - expressionP->X_op = O_symbol; expressionP->X_add_symbol = symbolP; } @@ -604,11 +600,6 @@ integer_constant (int radix, expressionS *expressionP) name = fb_label_name (number, 1); symbolP = symbol_find_or_make (name); /* We have no need to check symbol properties. */ -#ifndef many_segments - /* Since "know" puts its arg into a "string", we - can't have newlines in the argument. */ - know (S_GET_SEGMENT (symbolP) == undefined_section || S_GET_SEGMENT (symbolP) == text_section || S_GET_SEGMENT (symbolP) == data_section); -#endif expressionP->X_op = O_symbol; expressionP->X_add_symbol = symbolP; expressionP->X_add_number = 0;