From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by sourceware.org (Postfix) with ESMTPS id 4D07138582A7 for ; Fri, 15 Jul 2022 04:50:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4D07138582A7 Received: by mail-pj1-x102b.google.com with SMTP id o5-20020a17090a3d4500b001ef76490983so5038600pjf.2 for ; Thu, 14 Jul 2022 21:50:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gWD4XlFGW4tXe8dDRQ8hvIi+wFLfaQmzK0diWRnOqmw=; b=04B+uDcotSYQ4TiCfS3fLPbY7FuDYlfEA00B7pr3LKvejXW+NOdmMOa5PScIC5hLr6 fneDXWiebsGXBQIJHFwqx6UL4BaJDy9Hhi4vFggZyQa84w+27tP2YfdSxnt/7YBYMU0l 2x5fwSf9YKKt7jBGKHT9w2IIqcwIp7417tOS9NYRJb5w3UH0gBFjCNpuQI/6gc8JzUU9 6TpbXKBVpFe0UefZ9G2Sya6iFI5NJdTvR2yokSiu+AyoQcfNKvbHMTsmp7kOWTZ0xDWQ F36ebRMkvgVitW4v6u17gkHy1MZXB6VvmuROy5emVdprHRbegf3spwTUUrEIP2i1O1YK QbbA== X-Gm-Message-State: AJIora9NmW8eOgkPN2r3NgJSTZxZCfOSh/zfwl92U7Fjhi+OLnO3F649 c/+Iu7/K8anVOVWYE+au7Vc= X-Google-Smtp-Source: AGRyM1v5GEgyr+pBzvXoEPskHY/wYeixG5q79rOAJ++9pneg8w1HBAIeEhDq1un1lG0W02K6TA2jBw== X-Received: by 2002:a17:902:eec2:b0:16b:e389:7efe with SMTP id h2-20020a170902eec200b0016be3897efemr11999187plb.84.1657860617346; Thu, 14 Jul 2022 21:50:17 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:9221:30ee:1c7a:bc7c]) by smtp.gmail.com with ESMTPSA id h14-20020a63e14e000000b004161b3c3388sm2253740pgk.26.2022.07.14.21.50.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 21:50:16 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 6F7591140472; Fri, 15 Jul 2022 14:20:13 +0930 (ACST) Date: Fri, 15 Jul 2022 14:20:13 +0930 From: Alan Modra To: Dmitry Selyutin Cc: binutils@sourceware.org, Luke Kenneth Casson Leighton Subject: Re: [PATCH] gas/symbols: do not panic upon resolving O_md Message-ID: References: <20220714212651.297902-1-ghostmansd@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220714212651.297902-1-ghostmansd@gmail.com> X-Spam-Status: No, score=-3036.1 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-List-Received-Date: Fri, 15 Jul 2022 04:50:19 -0000 On Fri, Jul 15, 2022 at 12:26:52AM +0300, Dmitry Selyutin wrote: > Assuming GMSD is a special operand, marked as O_md1, the code: > > .set VREG, GMSD > .set REG, VREG > extsw REG, 2 > > ...fails upon attempts to resolve the value of the symbol. This happens > since machine-dependent values are not handled in the giant op switch. > > Machine-dependent expressions don't really need to be resolved, since > the resolving process is really machine-dependent. We could have marked > such symbols as resolving in port. However, we don't want to access > the field which seems to be internal, and we especially don't want > to perform this for each and every port. > --- > gas/symbols.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/gas/symbols.c b/gas/symbols.c > index 6904a3102c..fd2117f7da 100644 > --- a/gas/symbols.c > +++ b/gas/symbols.c > @@ -1408,6 +1408,16 @@ resolve_symbol_value (symbolS *symp) > BAD_CASE (op); > break; > > + case O_md1...O_md32: Please don't use gcc extensions. > + /* Machine-dependent expressions don't really need > + * to be resolved, since the resolving process is > + * really machine-dependent. We could have marked > + * such symbols as resolving in port. However, we > + * don't want to access the field which seems to be > + * internal, and we especially don't want to perform > + * this for each and every port. */ > + break; This might avoid the fatal error, but will still hit an error later due to resolved not being set. I think this calls for an md_resolve_symbol. > + > case O_absent: > final_val = 0; > /* Fall through. */ > -- > 2.37.0 -- Alan Modra Australia Development Lab, IBM