[PATCH 4/8] symbols/ppc: don't use symbols-dummy

Jan Beulich posted 8 patches 2 weeks, 3 days ago
[PATCH 4/8] symbols/ppc: don't use symbols-dummy
Posted by Jan Beulich 2 weeks, 3 days ago
In particular when linking with lld, which converts hidden symbols to
local ones, the ELF symbol table can change in unhelpful ways between the
first two linking passes, resulting in the .rodata contributions to change
between the 2nd and 3rd pass. That, however, renders our embedded symbol
table pretty much unusable; the recently introduced self-test may then
also fail. (Another difference between compiling a C file and assembling
the generated ones is that - with -fdata-sections in use - the .rodata
contributions move between passes 1 and 2, when we'd prefer them not to.)

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/ppc/Makefile
+++ b/xen/arch/ppc/Makefile
@@ -12,8 +12,10 @@ $(TARGET): $(TARGET)-syms
 	cp -f $< $@
 
 $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
+	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
+	$(MAKE) $(build)=$(@D) $(dot-target).0.o
 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
-	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
+	      $(dot-target).0.o -o $(dot-target).0
 	$(NM) -pa --format=sysv $(dot-target).0 \
 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
 		> $(dot-target).1.S
Re: [PATCH 4/8] symbols/ppc: don't use symbols-dummy
Posted by Timothy Pearson 2 weeks, 3 days ago

----- Original Message -----
> From: "Jan Beulich" <jbeulich@suse.com>
> To: "xen-devel" <xen-devel@lists.xenproject.org>
> Cc: "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>, "Roger
> Pau Monné" <roger.pau@citrix.com>, "Timothy Pearson" <tpearson@raptorengineering.com>
> Sent: Wednesday, November 26, 2025 7:43:46 AM
> Subject: [PATCH 4/8] symbols/ppc: don't use symbols-dummy

> In particular when linking with lld, which converts hidden symbols to
> local ones, the ELF symbol table can change in unhelpful ways between the
> first two linking passes, resulting in the .rodata contributions to change
> between the 2nd and 3rd pass. That, however, renders our embedded symbol
> table pretty much unusable; the recently introduced self-test may then
> also fail. (Another difference between compiling a C file and assembling
> the generated ones is that - with -fdata-sections in use - the .rodata
> contributions move between passes 1 and 2, when we'd prefer them not to.)
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Looks good to me.  Thanks!

Acked-by: Timothy Pearson <tpearson@raptorengineering.com>

> --- a/xen/arch/ppc/Makefile
> +++ b/xen/arch/ppc/Makefile
> @@ -12,8 +12,10 @@ $(TARGET): $(TARGET)-syms
> 	cp -f $< $@
> 
> $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
> +	$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
> +	$(MAKE) $(build)=$(@D) $(dot-target).0.o
> 	$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \
> -	    $(objtree)/common/symbols-dummy.o -o $(dot-target).0
> +	      $(dot-target).0.o -o $(dot-target).0
> 	$(NM) -pa --format=sysv $(dot-target).0 \
> 		| $(objtree)/tools/symbols $(all_symbols) --sysv --sort \
>  		> $(dot-target).1.S