Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Ian Rogers" <irogers@google.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 2/3] perf symbol-elf: Fix zero-size symbol end calculation across .symtab and .dynsym
Date: Sat, 31 Oct 2026 06:41:36 +0000	[thread overview]
Message-ID: <sashiko-outbox-191785@kernel.org> (raw)
In-Reply-To: <20261031063549.1281324-3-irogers@google.com>

> When loading symbols from an ELF binary in dso__load_sym(),
> dso__load_sym_internal() can be invoked multiple times: first for
> .symtab (or .gnu_debugdata's .symtab) and then for .dynsym.
> 
> Previously, dso__load_sym_internal() ran symbols__fixup_end() and
> symbols__fixup_duplicate() at the end of each individual symbol table
> load. Consequently, a zero-size symbol in .symtab had its end address
> extended to the start of the next .symtab symbol before .dynsym was
> loaded. If an exported function existed only in .dynsym (for example,
> when stripped from .symtab or when using .gnu_debugdata minidebuginfo)
> at an address between the two .symtab symbols, the zero-size .symtab
> symbol overlapped the .dynsym function and samples inside the .dynsym
> function were misattributed to the preceding zero-size symbol.
> 
> Move symbols__fixup_end(), symbols__fixup_duplicate(), and
> maps__fixup_end() from dso__load_sym_internal() to dso__load_sym() so
> they run once after all symbol tables have been loaded into the DSO, and
> add a unit test in 'perf test symbols' verifying that a zero-size
> .symtab symbol ends at a following .dynsym-only function rather than
> overlapping it.
> 
> Fixes: 87704345cc60 ("perf symbol-elf: Decode dynsym even if symtab exists")
> Fixes: b10f74308e13 ("perf symbol: Support .gnu_debugdata for symbols")
> Suggested-by: Alireza Haghdoost <haghdoost@uber.com>
> Signed-off-by: Ian Rogers <irogers@google.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261031063549.1281324-1-irogers@google.com?part=2


  reply	other threads:[~2026-10-31  6:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  6:35 [PATCH 0/3] perf symbols/callchain/annotate: Bug fixes from symbol reference counting review Ian Rogers
2026-10-31  6:35 ` [PATCH 1/3] perf callchain: Fix loss of symbol in merge_chain_branch() Ian Rogers
2026-10-31  6:39   ` sashiko-bot
2026-10-31  6:35 ` [PATCH 2/3] perf symbol-elf: Fix zero-size symbol end calculation across .symtab and .dynsym Ian Rogers
2026-10-31  6:41   ` sashiko-bot [this message]
2026-10-31  6:35 ` [PATCH 3/3] perf annotate: Fix block_range symbol loss on split and leaks on exit Ian Rogers
2026-10-31  6:47   ` sashiko-bot

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=sashiko-outbox-191785@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=irogers@google.com \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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