From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Julien Grall <julien@xen.org>,
Stefano Stabellini <sstabellini@kernel.org>,
Anthony PERARD <anthony.perard@vates.tech>,
Michal Orzel <michal.orzel@amd.com>,
Oleksii Kurochko <oleksii.kurochko@gmail.com>
Subject: Re: [PATCH] symbols: explicitly specify source file name for symtab
Date: Tue, 12 May 2026 11:20:23 +0200 [thread overview]
Message-ID: <agLw10IR1KO3tNKX@macbook.local> (raw)
In-Reply-To: <f921abc1-1f1a-4ef1-b21b-a65b5d50eafd@suse.com>
On Mon, May 11, 2026 at 12:00:03PM +0200, Jan Beulich wrote:
> If there are any local symbols in an object file, GNU ld will create an
> STT_FILE symbol derived from the object file name if there is none in the
> incoming symbol table. The object file name, however, varies between
> linking passes. As a result, symbol name compression can yield different
> results if any of those local symbols need retaining (Arm [and RISC-V]
> mapping symbols are omitted, for example). If that difference in
> compression would yield a difference in the sizes of symbol_names[] or
> symbols_token_table[], the compare-symbol-tables sanity check will fail.
>
> Fixes: d37d63d4b548 ("symbols: prefix static symbols with their source file names")
> Reported-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> The observed problem was with a stub generated as Arm64 erratum 843419
> workaround. Such stubs' symbols (imo wrongly) are associated with the last
> input object, rather than the input object they belong to. Also for other
> kinds of stubs, afaict. See
> https://sourceware.org/bugzilla/show_bug.cgi?id=34140.
>
> As per the above, having a Fixes: tag here is questionable.
>
> --- a/xen/arch/x86/Makefile
> +++ b/xen/arch/x86/Makefile
> @@ -200,7 +200,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(no
> ifeq ($(CONFIG_DEBUG_INFO),y)
> $(if $(filter --strip-debug,$(EFI_LDFLAGS)),echo,:) "Will strip debug info from $(@F)"
> endif
> - $(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0s.S
> + $(objtree)/tools/symbols $(all_symbols) --source-name=$(@F).S --empty \
> + > $(dot-target).0s.S
> $(MAKE) $(build)=$(@D) .$(@F).0s.o
> $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
> $(LD) $(call EFI_LDFLAGS,$(base)) -T $(obj)/efi.lds $< $(relocs-dummy) \
> @@ -210,6 +211,7 @@ endif
> > $(dot-target).1r.S
> $(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).0 \
> | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
> + --source-name=$(@F).S \
> > $(dot-target).1s.S
> $(MAKE) $(build)=$(@D) .$(@F).1r.o .$(@F).1s.o
> $(foreach base, $(VIRT_BASE) $(ALT_BASE), \
> @@ -220,6 +222,7 @@ endif
> > $(dot-target).2r.S
> $(NM) -pa --format=sysv $(dot-target).$(VIRT_BASE).1 \
> | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
> + --source-name=$(@F).S \
> > $(dot-target).2s.S
Wouldn't it be more accurate to use $(dot-target) as the source name?
Maybe $(notdir $(dot-target)).S?
I see the default is already set to the target filename for other
arches, so not a big deal IMO.
Thanks, Roger.
next prev parent reply other threads:[~2026-05-12 9:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 10:00 [PATCH] symbols: explicitly specify source file name for symtab Jan Beulich
2026-05-11 13:41 ` Andrew Cooper
2026-05-11 13:47 ` Jan Beulich
2026-05-11 13:52 ` Oleksii Kurochko
2026-05-12 9:20 ` Roger Pau Monné [this message]
2026-05-12 10:51 ` Jan Beulich
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=agLw10IR1KO3tNKX@macbook.local \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
/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.