From: Fangrui Song <maskray@google.com>
To: Alexandre Oliva <oliva@adacore.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
Jan Hubicka <hubicka@ucw.cz>, Nathan Sidwell <nathan@acm.org>,
gcc-patches@gcc.gnu.org, jason@redhat.com,
joseph@codesourcery.com, hainque@adacore.com,
ebotcazou@adacore.com
Subject: Re: [PATCH v4] Introduce attribute sym
Date: Fri, 21 Jul 2023 20:12:13 -0700 [thread overview]
Message-ID: <CAFP8O3J+PgBfWRLw5O-utEUaSanQMWehhZHDwvTa==DKEoCE8w@mail.gmail.com> (raw)
In-Reply-To: <orwmyvzece.fsf_-_@lxoliva.fsfla.org>
On Wed, Jul 19, 2023 at 4:12 PM Alexandre Oliva via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Jul 18, 2023, Richard Biener <richard.guenther@gmail.com> wrote:
>
> > I think the __symver__ attribute does something similar already so
> > maybe use __attribute__((__sym__("foo")))?
>
> Cool, thanks, that will do. Regstrapped on x86_64-linux-gnu. Ok to
> install?
>
>
> This patch introduces an attribute to add extra asm names (aliases)
> for a decl when its definition is output. The main goal is to ease
> interfacing C++ with Ada, as C++ mangled names have to be named, and
> in some cases (e.g. when using stdint.h typedefs in function
> arguments) the symbol names may vary across platforms.
>
> The attribute is usable in C and C++, presumably in all C-family
> languages. It can be attached to global variables and functions. In
> C++, it can also be attached to class types, namespace-scoped
> variables and functions, static data members, member functions,
> explicit instantiations and specializations of template functions,
> members and classes.
>
> When applied to constructors or destructor, additional sym aliases
> with _Base and _Del suffixes are defined for variants other than
> complete-object ones. This changes the assumption that clones always
> carry the same attributes as their abstract declarations, so there is
> now a function to adjust them.
I wonder whether this attribute can be named "alias" without arguments.
alias ("target") is an existing attribute that applies to a
declaration. The new "alias" without arguments can apply to
definitions.
I am just thinking that the semantics of "sym" may confuse users who
are familiar with "alias" :)
next prev parent reply other threads:[~2023-07-22 3:12 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-29 20:56 [RFC, WIP] introduce attribute exalias Alexandre Oliva
2020-08-07 17:38 ` [PATCH] " Alexandre Oliva
2020-08-14 15:39 ` Alexandre Oliva
2020-08-14 16:24 ` Nathan Sidwell
2020-08-14 19:24 ` Alexandre Oliva
2020-08-14 22:12 ` Nathan Sidwell
2020-08-15 2:43 ` Alexandre Oliva
2020-08-15 9:22 ` Iain Sandoe
2020-08-15 16:39 ` Alexandre Oliva
2020-08-15 18:17 ` Iain Sandoe
2020-08-25 8:34 ` Alexandre Oliva
2020-08-25 11:23 ` Iain Sandoe
2020-08-15 17:26 ` Alexandre Oliva
2020-08-15 21:11 ` Nathan Sidwell
2020-08-25 7:50 ` Alexandre Oliva
2023-07-15 1:08 ` [PATCH v3] Introduce attribute reverse_alias Alexandre Oliva
2023-07-15 21:55 ` Nathan Sidwell
2023-07-18 4:29 ` Alexandre Oliva
2023-07-18 11:37 ` Richard Biener
2023-07-19 23:11 ` [PATCH v4] Introduce attribute sym Alexandre Oliva
2023-07-20 13:09 ` Richard Biener
2023-07-21 9:23 ` Alexandre Oliva
2023-07-22 3:12 ` Fangrui Song [this message]
2023-08-16 4:27 ` Alexandre Oliva
[not found] ` <orpm2tgrsd.fsf_-_@lxoliva.fsfla.org>
[not found] ` <CAH6eHdQ3vT3MjohuE-izto+K=BMRykY3T-UyWa5-=OTDPM-JsQ@mail.gmail.com>
[not found] ` <ory1h9t6nr.fsf@lxoliva.fsfla.org>
2023-09-20 5:59 ` [PATCH v5] Introduce attribute sym_alias (was: Last call for bikeshedding on attribute sym/exalias/reverse_alias) Alexandre Oliva
2023-11-20 12:54 ` [PATCH v5] Introduce attribute sym_alias Alexandre Oliva
2023-11-22 12:14 ` Richard Biener
2023-11-22 19:16 ` Joseph Myers
2023-11-22 13:13 ` [PATCH v5] Introduce attribute sym_alias (was: Last call for bikeshedding on attribute sym/exalias/reverse_alias) Jan Hubicka
2023-11-30 12:53 ` [PATCH v6] Introduce attribute sym_alias Alexandre Oliva
2023-11-30 15:24 ` Jan Hubicka
2023-12-01 11:25 ` [PATCH v7] " Alexandre Oliva
2023-12-06 2:10 ` [PATCH v8] " Alexandre Oliva
2023-12-06 10:06 ` [PATCH v7] " Jan Hubicka
2023-12-07 20:52 ` Alexandre Oliva
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFP8O3J+PgBfWRLw5O-utEUaSanQMWehhZHDwvTa==DKEoCE8w@mail.gmail.com' \
--to=maskray@google.com \
--cc=ebotcazou@adacore.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=hainque@adacore.com \
--cc=hubicka@ucw.cz \
--cc=jason@redhat.com \
--cc=joseph@codesourcery.com \
--cc=nathan@acm.org \
--cc=oliva@adacore.com \
--cc=richard.guenther@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).