From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by sourceware.org (Postfix) with ESMTPS id 9C7323858C52 for ; Mon, 10 Apr 2023 14:51:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9C7323858C52 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-yw1-x112c.google.com with SMTP id 00721157ae682-54ee17a659bso104548107b3.4 for ; Mon, 10 Apr 2023 07:51:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1681138273; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=rEeRTD8QF5JNtBIewkN791+IHGSKseXD3rakZrcg4ZQ=; b=J2GTiq7RLV/3aAGQ7Jy/5oa/7leNyXARLfxW7HZ9cpqYR/UyLbPT6eBKneep6qfilw M6clPixalm3iJA+qUJkFwBCsbxBUwmDpG3asob8gV9tIP/XIkG5ICLDU0sD5aUdX2MJI HKSlZ9meO3DIMREt+wxsntHEx0G2aKWUBB03o1X/D469H3c393NafL3rYi0cuTMCWK4V vmdlb0DJyQoyKSYieO3cCxd3JVvAKLJ4znex4AID2e59A9DKfdQtcPqRVoRcVDKeq0kb w8x2O+BVyOzu+ONwmC/v9YaR6S1lvVWAOQk8ClNcdwDk+N0Xi+KPdNTf2BoyIQejw/xG A42w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681138273; 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=rEeRTD8QF5JNtBIewkN791+IHGSKseXD3rakZrcg4ZQ=; b=euSbh+LPkfZ7/tmvsMQfK+rqQYm/MFq0Dhqrll5uUw1d50NeGShCfdvbCyslj2Dmb1 D3PAoIBzqEwk826i5NYIj8u+hTEHEuq6lKaK1zTbG2B13kHk4x51nTyd+kKmA8c6i1mG swPDwvo+HX9TOUbr4iLf+gakvGqGW4t+kh94smUVHhzwPqtcvO1Vdbo9K6LWx285fbXU 4lQemogBZM8vqfwk1VGVfc2Frj8mNCBBXhHhYAZzojylJxaK0cIrt6NGObg4nqaDCHfr Xw2W3FR7dmh+hhFGcvNv+WzWRCYOrpr/QxcN6qIhCnhvG/5I9/gb/Es//ns+M9B9+Da2 OsxQ== X-Gm-Message-State: AAQBX9cLdHjm3ymATgX0ZeniyHiMU+oIqORWLM0HylDcu78dTW3fF8Z1 3phc/UKGBAPpimmcvfOvGhQBJYggtAcPlQqSMHM= X-Google-Smtp-Source: AKy350YQgfXYxqJAqnz5XdARE7qIB28k+eXXCm28k0OOT77u7w7HejshblOSd91Ubjyeu94oc7V34BbVrHZ/DiasTNM= X-Received: by 2002:a81:a94a:0:b0:541:a0ab:bd28 with SMTP id g71-20020a81a94a000000b00541a0abbd28mr6623027ywh.4.1681138272881; Mon, 10 Apr 2023 07:51:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Joshua Saxby Date: Mon, 10 Apr 2023 15:51:02 +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="00000000000092d0a405f8fc8133" X-Spam-Status: No, score=1.5 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: --00000000000092d0a405f8fc8133 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 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:43, Marc Nieper-Wi=C3=9Fkirchen 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/725bcdeec60771cb9ee387978716028b64= ea1b7f/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 the > > assembler itself (I could assume it's identical to C symbol naming rule= s, > > 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 B7A9 > 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] > --00000000000092d0a405f8fc8133--