From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C833D3858C32; Tue, 28 May 2024 05:29:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C833D3858C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1716874163; bh=NfU17TCBYmoRWR2leKnRqf3OAKNpsBJ/JYDpUK/fWAA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=BGban1kUCFmF6FC4WeNwuML9nQX0FaV4HolGgnE4niVIzcTHQvHlj4Q2+uraesN5G fW3g7eB5rG8fninayjYq+N+jneYXHAJRIwJs0TTW3G8VXX0GpbudqAWlvpkMzUhC/M /XDJlLaL/MDuf79kD4ENuRmw4mXENVvNkB/46dgw= From: "i at maskray dot me" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/105576] x86: Support a machine constraint to get raw symbol name Date: Tue, 28 May 2024 05:29:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: inline-asm X-Bugzilla-Severity: normal X-Bugzilla-Who: i at maskray dot me X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105576 --- Comment #14 from Fangrui Song --- > Is there a way to capture a method address in inline asm that works in > -fPIC mode? Specifically I want to capture the address of a static > method that's in a class that's local to a function. I'm able to do it > in non-PIC mode but not PIC mode. I have a write up how to support raw symbol names for different architectur= es https://maskray.me/blog/2024-01-30-raw-symbol-names-in-inline-assembly Summary: AArch32: "US" (for symbol reference without an offset) AArch64: "S" x86: "Ws", GCC 14+, Clang 18+ MIPS/PowerPC/RISC-V: "s" I hope that newer ports all define LEGITIMATE_PIC_OPERAND_P so that "s" can= be used.=