From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id D1A653858D32 for ; Mon, 13 Mar 2023 12:06:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D1A653858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678709206; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MdG/YQGbEyupn8NX8uEUj737BgS0VI/D2JIHGREZr/k=; b=KPsYDlHQHCurko2O2C5yunDwQSVhYor1Q1kiTalJzQsw4ENd0eR+KcCh7CtsOIZ4ZDOLbh qR91j61Ihqn9yabZmZZYw3W4kPvozSju3Fy5VwLfWmKpKQrtHSP8YwWxoed+0DQOWmD4C/ zIMh4/ySd0Tm/IoTc9QwlrHjnFqke7k= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-610-m9IjfUJDNqutXhqnkp6ttw-1; Mon, 13 Mar 2023 08:06:45 -0400 X-MC-Unique: m9IjfUJDNqutXhqnkp6ttw-1 Received: by mail-qv1-f70.google.com with SMTP id lt7-20020a056214570700b0057290f3623eso6833981qvb.3 for ; Mon, 13 Mar 2023 05:06:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678709205; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MdG/YQGbEyupn8NX8uEUj737BgS0VI/D2JIHGREZr/k=; b=Al5LzlZ8yfeabJv9F0pSgbRybjelRToxm3cRXwiCD0T2TAeC/3pYHNGRd+maEv7FXv 7y0dhfP6Z/hX+DZb8QgNUxQuMqV0/wUrY0YpVh8Z6vHENWpO3M9rPnYbLNBk8873N2oO BgsyMFZ2newLqus8FcY5Wzc1xJZMBiP3rhfb1HooyHBxchjr3OgFZdlc6L6X+NIJeQkn 3aZy3KccX3MKUmJHnTvuhrVAlH+pBr7WidL4+atPB0Dumf3ZhXosL0l2fTGRO3ys610U jxZ1m7sSjDKVO70Fxcj1bNjB8Ua6ub+UXX8R0psZs99Sxj7Gb1J0KgZujyx/oXvVNoZj go6Q== X-Gm-Message-State: AO0yUKXkljfkCFlB1QtcRVYh9U6XBKmldViOnh7++xl4+KmDt6vFvuR6 6V1yAkX8qEaBYf20KYvqiptjwAAg7qpRXQW4FjHVBuHHltIUqwrk7gKmF2EH5Med8c6XCzmuxD7 BE9BDgbn1qWAQVkeX6g== X-Received: by 2002:ac8:5c82:0:b0:3bd:ad1:49c with SMTP id r2-20020ac85c82000000b003bd0ad1049cmr52281417qta.24.1678709204848; Mon, 13 Mar 2023 05:06:44 -0700 (PDT) X-Google-Smtp-Source: AK7set8gnyj96vXMjueD6zV7o2oZGCTYYtDEm3lFVoW0zG4NelEoOi1Jph3LMJUDGh3zK5ryduxnSA== X-Received: by 2002:ac8:5c82:0:b0:3bd:ad1:49c with SMTP id r2-20020ac85c82000000b003bd0ad1049cmr52281391qta.24.1678709204586; Mon, 13 Mar 2023 05:06:44 -0700 (PDT) Received: from [192.168.1.7] ([79.123.86.193]) by smtp.gmail.com with ESMTPSA id 75-20020a370c4e000000b00745793b5fa5sm2244684qkm.45.2023.03.13.05.06.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Mar 2023 05:06:44 -0700 (PDT) Message-ID: Date: Mon, 13 Mar 2023 12:06:41 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 To: Jan Beulich , Alan Modra Cc: Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Binutils References: <150b4184-62af-3f5c-c07b-24b0c2ae788f@suse.com> <9f769d26-f51c-4f85-f61b-330226c1cc2d@suse.com> From: Nick Clifton Subject: Re: [PATCH RFC] RISC-V: alter the special character used in FAKE_LABEL_NAME In-Reply-To: <9f769d26-f51c-4f85-f61b-330226c1cc2d@suse.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: Hi Jan, > On 10.03.2023 10:36, Jan Beulich via Binutils wrote: >> Considering the special casing of FAKE_LABEL_CHAR in read_symbol_name() >> and get_symbol_name() I wonder in how far LOCAL_LABEL_CHAR and/or >> DOLLAR_LABEL_CHAR don't also need recognizing there (and then also be >> marked in lex[] just like done here). I can't point out a specific case >> though where there could be a problem. >> >> The checking for *_LABEL_CHAR in S_IS_LOCAL() looks to collide with uses >> of these characters in quoted symbol names. > > while the rest of the open questions is RISC-V specific, these two items > are not, and since from the title I suppose you may not notice the generic > aspects here, I thought I'd point them out explicitly. Just in case you > have any thoughts there (if you don't, I'm not sure how to progress). Thanks for bringing this up, and you are right, I had not noticed these generic questions. My thoughts on this topic are as follows: I think that the intention of FAKE_LABEL_CHAR is to allow backends to generate labels contains characters that are not normally accepted as part of a label's name, but which nevertheless should be treated as if they were real user-provided names. The LOCAL_LABEL_CHAR and DOLLAR_LABEL_CHAR characters on the other hand are intended solely for internal assembler use and should never appear in user-generated, or backend-generated labels. Hence it makes sense to check for FAKE_LABEL_CHAR to be checked in functions that read user labels (read.c:read_symbol_name(), expr.c:get_symbol_name()) and it also makes sense to not check for - and by implication, reject - LOCAL_LABEL_CHAR and DOLLAR_LABEL_CHAR. There is a special case however. If a backend does not define FAKE_LABEL_NAME (and FAKE_LABEL_CHAR) then write.h will define them instead and it will use the same default character as DOLLAR_LABEL_CHAR. I am not sure why this was done, possibly it was a mistake - it might have been better to use a different control character, eg '\0003' instead. Anyway, the header is written that way at the moment, and this is why there is a (not actually needed) check in S_IS_LOCAL() for DOLLAR_LABEL_ CHAR and FAKE_LABEL_CHAR being the same. So in conclusion, I think that unless a backend wants to use a control character as a fake label name character, there should be no problems. Cheers Nick