From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by sourceware.org (Postfix) with ESMTPS id 9D45C3858D20 for ; Thu, 13 Apr 2023 15:15:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9D45C3858D20 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-yb1-xb2e.google.com with SMTP id e10so6712138ybp.4 for ; Thu, 13 Apr 2023 08:15:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681398905; x=1683990905; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7PxjbuqarsKIL6UQO/TZYp53tJskEuuDAwgyWvJclVk=; b=VWcIOnXvTki3IQ8WCKcZIp5hAVRKwGmKrU764pB4ggW1dAtsaGIIi+7r3DrLZMghwo lMRsbLMuB+RjEnzqoE56zy8WlIKctKxzdQT2yHyi2eDizZN09vuQZEF7+c8tBnSvepC2 sVBLGJTx/dM2SVfZN3D9Gm54TzwMMRNtgHk8BCQR7mZcyiFjZmXHTE1rDNr4A1pgjat0 ADQ6LZFIiZMRe9WNWG4CMPgcJAuGAVLEFWxvnsI05myDbzhHvukd8T2ZXGUWZlJbJ3eE 2CjbImkZdDUwSj9CPO3PDhWFhn+MemA6Qim/G/m+DnQMAu7SNgifS9wnz5wBsarf2qzb i93Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681398905; x=1683990905; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7PxjbuqarsKIL6UQO/TZYp53tJskEuuDAwgyWvJclVk=; b=liJGDsaLUhangwj/GwwUNXKUgqtIV8S6MbZdLCP+0ejkDjEwY8wzVnv+it902RBjJS FA9BQoHRl40y88c8sm/Q7zvAo4jLWP4aPKtArZ3+S6y+lSDIunEYPKeUVrivyCI+ii+W RiNnSQR3nJeaVVH0fBdf+bZz+/T+VXHCNjK8vli/cO++f2Hapc4nIfHvBrKGkH/l1cVD KDD3f1JAuVAJEebDxw3AHFEkZHZ4iz9OUlPkmRndkEtOLBai6q5GzZF1+yz5PMp0xoRJ 39oJoXY0WBACBttIRDrJFR3lpsGlKIYWlvwMLNNkPqFWEa27vT0kY+PEVncK2VnABZMN tEbA== X-Gm-Message-State: AAQBX9ff+fwWT+T+bZ2b+4TmVw/nVC2KCQXUfM9fUSvM7AoGbN0l2Lqq 29hm4CVpCCaQdb4xMf5DGBt618kWSEYYC1maPTM= X-Google-Smtp-Source: AKy350YWwF5qfzfYOpj2TtyFjLhL7W7s8jEWHdyop7V+uID7h+BNFqzDiN7hlqpchjypBDZbMrf4gfwD16Yc41FWIzw= X-Received: by 2002:a25:d7ca:0:b0:b8e:ce2d:290a with SMTP id o193-20020a25d7ca000000b00b8ece2d290amr1297506ybg.11.1681398904728; Thu, 13 Apr 2023 08:15:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joshua Saxby Date: Thu, 13 Apr 2023 16:14:53 +0100 Message-ID: Subject: Re: Symbol name character restrictions To: =?UTF-8?Q?Marc_Nieper=2DWi=C3=9Fkirchen?= Cc: jit@gcc.gnu.org Content-Type: multipart/alternative; boundary="00000000000071322705f93930fb" X-Spam-Status: No, score=1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000071322705f93930fb Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I've done some further digging, and it appears this feature was added to GNU as about 8 years ago: https://github.com/bminor/binutils-gdb/commit/d02603dc201f80cd9d2a1f4b1a161= 10b1e04222b (commit: d02603d "Allow symbol and label names to be enclosed in double quotes.") I guess libgccjit predates this and the change wasn't propagated to it. I think I will do some hacking on libgccjit to remove the check on symbol names locally and see if it works. Cheers, *J.S.* *My PGP Public Key Identity* pub 4096R/*B7A947E4* 2016-11-16 [expires: 2017-05-15] Key fingerprint =3D *E2C4 514F F0FA 52D1 896A B1D6 3D42 BFD9 B7A9 47= E4* uid Joshua Saxby uid Joshua Saxby (saxbophone) sub 4096R/0A445946 2016-11-16 [expires: 2017-05-15] On Mon, 10 Apr 2023 at 15:51, Joshua Saxby wrote: > Thanks for that info Marc, I can't believe I missed it! > > I had a feeling that assemblers/object files were pretty permissive to > symbol names at least in principle. > > This seems to contradict that comment from libgccjit source that I brought > up earlier, I wonder what other technical limitations (if any) are there = in > the character set that jit's symbols can support? > > Thanks, > *J.S.* > > > > *My PGP Public Key Identity* > > pub 4096R/*B7A947E4* 2016-11-16 [expires: 2017-05-15] > Key fingerprint =3D *E2C4 514F F0FA 52D1 896A B1D6 3D42 BFD9 B7A9 > 47E4* > uid Joshua Saxby > uid Joshua Saxby (saxbophone) > sub 4096R/0A445946 2016-11-16 [expires: 2017-05-15] > > > > > On Mon, 10 Apr 2023 at 15:43, Marc Nieper-Wi=C3=9Fkirchen < > marc.nieper@gmail.com> wrote: > >> According to the documentation of the GNU assembler at >> https://sourceware.org/binutils/docs/as/Symbol-Intro.html, any >> characters except for the NUL character are allowed in symbol names. >> >> Am Mo., 10. Apr. 2023 um 16:40 Uhr schrieb Joshua Saxby via Jit >> : >> > >> > Dear All, >> > >> > I noticed that currently libgccjit restricts symbol names for generated >> > functions (and I assume all other symbols) to match the rules for C >> symbol >> > names, that is, alphanumeric and underscores. >> > >> > From the source for gcc_jit_context_new_function() ( >> > >> https://github.com/gcc-mirror/gcc/blob/725bcdeec60771cb9ee387978716028b6= 4ea1b7f/gcc/jit/libgccjit.cc#L1173-L1177 >> > ): >> > >> > /* The assembler can only handle certain names, so for now, enforce >> > C's rules for identifiers upon the name, using ISALPHA and ISALNUM >> > from safe-ctype.h to ignore the current locale. >> > Eventually we'll need some way to interact with e.g. C++ name >> > mangling. */ >> > >> > I've seen some suggestions elsewhere that some assemblers can handle >> > symbols with wider varieties of symbols than these, I have struggled to >> > find any documentation of the exact restrictions on symbol-naming in t= he >> > assembler itself (I could assume it's identical to C symbol naming >> rules, >> > but I like to be sure), any pointers to where I could find such a >> > specification? Also, any plans to follow up on the hinted extension >> toward >> > the end of that comment, RE C++ name mangling? >> > >> > Best Regards, >> > >> > *J.S.* >> > >> > >> > >> > *My PGP Public Key Identity* >> > >> > pub 4096R/*B7A947E4* 2016-11-16 [expires: 2025-12-31] >> > Key fingerprint =3D *E2C4 514F F0FA 52D1 896A B1D6 3D42 BFD9 B7= A9 >> 47E4* >> > uid Joshua Saxby < >> joshua.a.saxby+UMvLnvbsOxBHaeiCHvbdunpz@gmail.com> >> > uid Joshua Saxby (saxbophone) < >> joshua.a.saxby@gmail.com> >> > sub 4096R/0A445946 2016-11-16 [expires: 2025-12-31] >> > --00000000000071322705f93930fb--