[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] symbols: explicitly specify source file name for symtab


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 12 May 2026 11:20:23 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YWM+ag0W9mhABysx3tzXRLWlPkiACGfWHmZFRB1ABz8=; b=qnU9E2PvIBlN8blnHyF2crqBoR7kfz2Z6/F9ZGoUgjpXBWvyeirQRgmiOpLtqWGBzdySYv//Z5YUimzGnonzMnBaI/e9hbKeAcCQs1BJFX9V7WiN/Khh1TH8CA3kHzBrF60Of3LwKiEctFGs/MoWY92aWXjaUGO/4zqEtkDG71h1GNFBhqbI7D4d5DxytR686SKbQpM/4aFAIevCTdsE3VJL5sg79zjpbnGiF02kLAFeDpCG6oleerTvpluKA/qgISekh6oB29HaUee0qIHXfeVYpz9EIbwmFl9R+a1gVZpxVM8F3tcOxlMrpKkA51H8wvBzaO4XfU6c+RwAGYY/Xg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yJSuPQ7/6u+LsvjNqB41FHLsMYDpD3M/jQYjg0CT9AWBKSjsN92lwMQvmMpXw2EVMk14mzH1pCiZvuyHgB+QwCGgIBGwz/MTr6tAS2rlJoSwpK+uq+ojMTyxHnpkkYiKzYOtxSBkOu2+Y3O/a/3fhC3s8DJAPnjTahZcY/zQKI2XKZIrDXe9EWFNG3V7bao2BGfd8gAv8Te1VYsjdxnUBN/zVF+mG5bsRbCfwv1ug1afNPYqpRGDIItBlJgFlFsi7eNWqOuKi3CD6G36X4/GW+AaGtT1P4+AQrqD+NNSA+uLnKxkWmVG6nmOx1rIGGyGlXl8fiobhn9ALSSeZeP6jQ==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=citrix.com header.i="@citrix.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
  • Delivery-date: Tue, 12 May 2026 09:20:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxx>
> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

Acked-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>

> ---
> 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.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.