From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Will Hawkins <hawkinsw@obs.cr>
Cc: dwarves@vger.kernel.org
Subject: Re: [PATCH 0/1] btf_loader support for subprogram linkage
Date: Mon, 26 Aug 2024 11:58:32 -0300 [thread overview]
Message-ID: <ZsyYGPUEtP5zP3i6@x1> (raw)
In-Reply-To: <ZsyXAcCv8sBwxLH1@x1>
On Mon, Aug 26, 2024 at 11:53:56AM -0300, Arnaldo Carvalho de Melo wrote:
> On Mon, Aug 26, 2024 at 11:52:13AM -0300, Arnaldo Carvalho de Melo wrote:
> > On Fri, Aug 23, 2024 at 05:28:30PM -0400, Will Hawkins wrote:
> > > First,
> > >
> > > I am a huge fan of pahole (and friends). I volunteered to work on
> > > helping to edit the BTF spec for the IETF and so I've started to look
> > > more deeply at BTF and the tools.
> > >
> > > Second, I hope that what I am offering is being sent to the right place
> > > and is in the right format. I tried to follow what seems to be the
> > > "right thing" by looking at mailing list archives.
> > >
> > > This patch add supports to the btf_loader for subprogram (BTF_KIND_FUNC)
> > > linkages. For example,
> > >
> > > ```
> > > $ cat a.c
> > > static int x() {
> > > return 5;
> > > }
> > > $ gcc -gbtf -g -O0 -c a.c
> > > $ ~/code/pahole/build/pfunct -Fbtf --compile a.o
> > > int x(void) /* linkage=static */
> > > {
> > > return 0;
> > > }
> > > ```
> >
> > So, I'm changing this to become:
> >
> > $ ~/code/pahole/build/pfunct -Fbtf --compile a.o
> > static int x(void)
> > {
> > return 0;
> > }
> >
> > As --compile is supposed to generate compileable code that is as much as
> > possible from the type information similar to the original code, ok?
>
> I see, your patch isn't the one adding that linkage comment, you're just
> collecting it from BTF, I'll then add a followup patch to get to the
> output I described.
So I'll looked up what that linkage field comes from and:
commit ce516fb0cf2a3d9fc45c2a9c7ab2cf4bd24965a0
Author: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Date: Sun Jul 8 19:47:26 2007 -0300
[LIB]: Support DW_AT_MIPS_linkage_name
Another C++ specific case:
- class TypeTemplate ByName(const string &, size_t);
+ class TypeTemplate ByName(const string &, size_t); /* linkage=_ZN4ROOT6Reflex12TypeTemplate6ByNameERKSsj */
Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
So its not really "static" or "stern", but the mangled name in languages
such as C++, so I think this patch needs reworking, there is ambiguity
on the "linkage" term, we should use some other term :-\
- Arnaldo
next prev parent reply other threads:[~2024-08-26 14:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-23 21:28 [PATCH 0/1] btf_loader support for subprogram linkage Will Hawkins
2024-08-23 21:28 ` [PATCH 1/1] btf_loader: Support linkages for BTF subprograms Will Hawkins
2024-08-26 7:50 ` Alan Maguire
2024-08-26 14:52 ` [PATCH 0/1] btf_loader support for subprogram linkage Arnaldo Carvalho de Melo
2024-08-26 14:53 ` Arnaldo Carvalho de Melo
2024-08-26 14:58 ` Arnaldo Carvalho de Melo [this message]
2024-08-26 16:36 ` Will Hawkins
2024-08-26 20:00 ` Arnaldo Carvalho de Melo
2024-08-26 20:24 ` Will Hawkins
2024-08-26 14:55 ` Will Hawkins
2024-08-27 4:09 ` [PATCH v2 " Will Hawkins
2024-08-27 14:37 ` Arnaldo Carvalho de Melo
2024-08-27 21:15 ` Will Hawkins
2024-08-27 4:09 ` [PATCH v2 1/1] btf_loader: Support linkages for BTF subprograms Will Hawkins
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=ZsyYGPUEtP5zP3i6@x1 \
--to=acme@kernel.org \
--cc=dwarves@vger.kernel.org \
--cc=hawkinsw@obs.cr \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.