symbols: mirror and then leverage recent x86 changes
cover symbols: mirror and then leverage recent x86 changes
1: arm: re-number intermediate files
2: arm: don't use symbols-dummy
3: ppc: re-number intermediate files
4: ppc: don't use symbols-dummy
5: riscv: re-number intermediate files
6: riscv: don't use symbols-dummy
7: drop symbols-dummy.c
8: check table sizes don't change between linking passes 2 and 3
As long as patch 8 is x86 only, it doesn't depend on the earlier ones.
Jan
PATCH 1/8 symbols/arm: re-number intermediate files
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
xen/arch/arm/Makefile +6 -6
@@ -89,16 +89,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S - $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]
Re: [PATCH 1/8] symbols/arm: re-number intermediate files
Hi Jan,
Quoted 6 lines · Jan Beulich
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH 2/8 symbols/arm: don't use symbols-dummy
In reply to Jan BeulichIn 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.)
xen/arch/arm/Makefile +3 -1
@@ -85,8 +85,10 @@ ifeq ($(CONFIG_ARM_64),y) endif $(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 2/8] symbols/arm: don't use symbols-dummy
Hi Jan,
Quoted 10 lines · Jan Beulich
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 <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH 3/8 symbols/ppc: re-number intermediate files
In reply to Jan BeulichIn preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
xen/arch/ppc/Makefile +6 -6
@@ -16,16 +16,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S - $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]
Re: [PATCH 3/8] symbols/ppc: re-number intermediate files
----- Original Message -----
Quoted 8 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>
Cc: "Andrew Cooper" <[email protected]>, "Julien Grall" <[email protected]>, "Stefano Stabellini" <[email protected]>, "Anthony PERARD" <[email protected]>, "Michal Orzel" <[email protected]>, "Roger Pau Monné" <[email protected]>, "Timothy Pearson" <[email protected]>
Sent: Wednesday, November 26, 2025 7:43:17 AM
Subject: [PATCH 3/8] symbols/ppc: re-number intermediate files
Quoted 6 lines
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich <[email protected]>
Looks good to me.
Quoted 25 lines
xen/arch/ppc/Makefile +6
-6@@ -16,16 +16,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S - $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]
Re: [PATCH 3/8] symbols/ppc: re-number intermediate files
Quoted 9 lines · Timothy Pearson
----- Original Message -----
Quoted 8 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Quoted 5 lines
Quoted 1 line
Signed-off-by Jan Beulich <[email protected]>Looks good to me.
Acked-by Timothy Pearson <[email protected]>
Thanks, but for clarification: This doesn't mean very much unless provided by a maintainer (M: in ./MAINTAINERS). As a reviewer, you'd use Reviewed-by:
to fulfill the purpose set forth in the textual part of that file. Provided of course you actually did a review.
Jan
Re: [PATCH 3/8] symbols/ppc: re-number intermediate files
----- Original Message -----
Quoted 20 lines
From: "Jan Beulich" <[email protected]>
To: "Timothy Pearson" <[email protected]>
Cc: "xen-devel" <[email protected]>, "Andrew Cooper" <[email protected]>, "Julien Grall" <[email protected]>, "Stefano Stabellini" <[email protected]>, "Anthony PERARD" <[email protected]>, "Michal Orzel" <[email protected]>, "Roger Pau Monné" <[email protected]>
Sent: Wednesday, November 26, 2025 8:11:55 AM
Subject: Re: [PATCH 3/8] symbols/ppc: re-number intermediate filesQuoted 11 lines · Timothy Pearson
----- Original Message -----
Quoted 9 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich <[email protected]>
Quoted 8 lines
Quoted 3 lines
Looks good to me.
Acked-by Timothy Pearson <[email protected]>Thanks, but for clarification: This doesn't mean very much unless provided by a maintainer (M: in ./MAINTAINERS). As a reviewer, you'd use Reviewed-by:
to fulfill the purpose set forth in the textual part of that file. Provided of course you actually did a review.
Understood, and yes, the patches were in fact reviewed. I will use the alternate string in the future.
Re: [PATCH 3/8] symbols/ppc: re-number intermediate files
Quoted 20 lines · Timothy Pearson
----- Original Message -----
Quoted 19 lines
From: "Jan Beulich" <[email protected]>
To: "Timothy Pearson" <[email protected]>Quoted 14 lines · Timothy Pearson
----- Original Message -----
Quoted 9 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich <[email protected]>Looks good to me.
Acked-by Timothy Pearson <[email protected]>
Quoted 7 lines
Quoted 4 lines
Thanks, but for clarification: This doesn't mean very much unless provided by a maintainer (M: in ./MAINTAINERS). As a reviewer, you'd use Reviewed-by:
to fulfill the purpose set forth in the textual part of that file. Provided of course you actually did a review.Understood, and yes, the patches were in fact reviewed. I will use the alternate string in the future.
Then still for the ones here: May I flip them to R-b, meaning the patches can in fact go in without anyone else's (i.e. a REST maintainer's) ack?
Jan
Re: [PATCH 3/8] symbols/ppc: re-number intermediate files
----- Original Message -----
Quoted 34 lines
From: "Jan Beulich" <[email protected]>
To: "Timothy Pearson" <[email protected]>
Cc: "xen-devel" <[email protected]>, "Andrew Cooper" <[email protected]>, "Julien Grall" <[email protected]>, "Stefano Stabellini" <[email protected]>, "Anthony PERARD" <[email protected]>, "Michal Orzel" <[email protected]>, "Roger Pau Monné" <[email protected]>
Sent: Wednesday, November 26, 2025 8:21:31 AM
Subject: Re: [PATCH 3/8] symbols/ppc: re-number intermediate filesQuoted 25 lines · Timothy Pearson
----- Original Message -----
Quoted 23 lines
From: "Jan Beulich" <[email protected]>
To: "Timothy Pearson" <[email protected]>Quoted 9 lines · Timothy Pearson
----- Original Message -----
Quoted 8 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Quoted 5 lines
Quoted 1 line
Signed-off-by Jan Beulich <[email protected]>Looks good to me.
Acked-by Timothy Pearson <[email protected]>Thanks, but for clarification: This doesn't mean very much unless provided by a maintainer (M: in ./MAINTAINERS). As a reviewer, you'd use Reviewed-by:
to fulfill the purpose set forth in the textual part of that file. Provided of course you actually did a review.
Quoted 7 lines
Quoted 2 lines
Understood, and yes, the patches were in fact reviewed. I will use the alternate string in the future.
Then still for the ones here: May I flip them to R-b, meaning the patches can in fact go in without anyone else's (i.e. a REST maintainer's) ack?
Jan
Yes, for both the [3/8] and [4/8] patches which I have personally reviewed.
PATCH 4/8 symbols/ppc: don't use symbols-dummy
In reply to Jan BeulichIn 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.)
xen/arch/ppc/Makefile +3 -1
@@ -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
----- Original Message -----
Quoted 17 lines
From: "Jan Beulich" <[email protected]>
To: "xen-devel" <[email protected]>
Cc: "Andrew Cooper" <[email protected]>, "Julien Grall" <[email protected]>, "Stefano Stabellini" <[email protected]>, "Anthony PERARD" <[email protected]>, "Michal Orzel" <[email protected]>, "Roger Pau Monné" <[email protected]>, "Timothy Pearson" <[email protected]>
Sent: Wednesday, November 26, 2025 7:43:46 AM
Subject: [PATCH 4/8] symbols/ppc: don't use symbols-dummyIn 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.)
Quoted 1 line
Signed-off-by Jan Beulich <[email protected]>
Looks good to me. Thanks!
Quoted 14 lines
xen/arch/ppc/Makefile +0
-0@@ -12,8 +12,10 @@ $(TARGET): $(TARGET)-syms cp -f $< $@$(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds
xen/arch/ppc/Makefile +2
-0+ $(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S + $(MAKE) $(build)=$(@D) $(dot-target).0.o$(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \xen/arch/ppc/Makefile +1
-1- $(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
PATCH 5/8 symbols/riscv: re-number intermediate files
In reply to Jan BeulichIn preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
xen/arch/riscv/Makefile +6 -6
@@ -26,16 +26,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S - $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]
Re: [PATCH 5/8] symbols/riscv: re-number intermediate files
Quoted 20 lines · Jan Beulich
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich<[email protected]>xen/arch/riscv/Makefile +3
-3@@ -26,16 +26,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1
xen/arch/riscv/Makefile $(TARGET)-syms: $(objtree)/prelink.o $(o · line 38
Quoted 10 lines
xen/arch/riscv/Makefile +2
-4$(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S - $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]
LGTM: Reviewed-By: Oleksii Kurochko<[email protected]>
~ Oleksii
Re: [PATCH 5/8] symbols/riscv: re-number intermediate files
Quoted 25 lines · Oleksii Kurochko
Quoted 23 lines · Jan Beulich
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich<[email protected]>xen/arch/riscv/Makefile +3
-4@@ -26,16 +26,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.S
Quoted 8 lines
xen/arch/riscv/Makefile $(TARGET)-syms: $(objtree)/prelink.o $(o · line 38
Quoted 7 lines
xen/arch/riscv/Makefile +2
-3- $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]LGTM: Reviewed-By: Oleksii Kurochko<[email protected]>
Thanks. May I remind you again that there wants to be a blank before the opening angle bracket? That is an issue which was also pointed out for some of your recent release-acks. (Canonically, the "-by" also wants to be all lower case, I think.)
Jan
Re: [PATCH 5/8] symbols/riscv: re-number intermediate files
Quoted 33 lines · Jan Beulich
Quoted 24 lines · Oleksii Kurochko
Quoted 23 lines · Jan Beulich
In preparation to do away with symbols-dummy, re-number the assembly and object files used, for the numbers to match the next passes real output. This is to make 0 available to use for what now is handled by symbols-dummy.
Signed-off-by Jan Beulich<[email protected]>xen/arch/riscv/Makefile +3
-4@@ -26,16 +26,16 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o $(objtree)/common/symbols-dummy.o -o $(dot-target).0 $(NM) -pa --format=sysv $(dot-target).0 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).0.S - $(MAKE) $(build)=$(@D) $(dot-target).0.o + > $(dot-target).1.S + $(MAKE) $(build)=$(@D) $(dot-target).1.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< \ - $(dot-target).0.o -o $(dot-target).1 + $(dot-target).1.o -o $(dot-target).1 $(NM) -pa --format=sysv $(dot-target).1 \ | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ - > $(dot-target).1.SQuoted 8 lines
xen/arch/riscv/Makefile $(TARGET)-syms: $(objtree)/prelink.o $(o · line 38
Quoted 7 lines
xen/arch/riscv/Makefile +2
-3- $(MAKE) $(build)=$(@D) $(dot-target).1.o + > $(dot-target).2.S + $(MAKE) $(build)=$(@D) $(dot-target).2.o $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ - $(dot-target).1.o -o $@ + $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \ | $(objtree)/tools/symbols --all-symbols --xensyms --sysv --sort \ > [email protected]LGTM: Reviewed-By: Oleksii Kurochko<[email protected]>
Quoted 3 lines
Thanks. May I remind you again that there wants to be a blank before the opening angle bracket? That is an issue which was also pointed out for some of your recent release-acks.
Hmm, something wrong with a setting in my e-mail app because I am looking at my reply in my e-mail app and there is a space before the opening angle bracket...
Quoted 2 lines
(Canonically, the "-by" also wants to
be all lower case, I think.)
I was sure that I had seen “-by” written with an uppercase letter, but I will use lowercase in the future. I tried using|git log --grep|, and it seems I was mistaken — “-by” is always lowercase.
I didn’t see your answer, so I made the same mistake with “-by” in the next patch as well.
~ Oleksii
PATCH 6/8 symbols/riscv: don't use symbols-dummy
In reply to Jan BeulichIn 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.)
xen/arch/riscv/Makefile +3 -1
@@ -22,8 +22,10 @@ $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ $(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 6/8] symbols/riscv: don't use symbols-dummy
Quoted 16 lines · Jan Beulich
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<[email protected]>xen/arch/riscv/Makefile +0
-0@@ -22,8 +22,10 @@ $(TARGET): $(TARGET)-syms $(OBJCOPY) -O binary -S $< $@ $(TARGET)-syms: $(objtree)/prelink.o $(obj)/xen.lds +$(objtree)/tools/symbols $(all_symbols) --empty > $(dot-target).0.S
xen/arch/riscv/Makefile $(TARGET): $(TARGET)-syms · line 31
Quoted 7 lines
xen/arch/riscv/Makefile +2
-1+ $(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
LGTM: Reviewed-By: Oleksii Kurochko<[email protected]>
~ Oleksii
PATCH 7/8 symbols: drop symbols-dummy.c
In reply to Jan BeulichNo architecture using it anymore, we can as well get rid of it.
---
Should we also drop common/symbols.h again then, by moving its contents back into common/symbols.c?
xen/common/Makefile +0 -2
@@ -74,8 +74,6 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y += domctl.o endif -extra-y := symbols-dummy.o - obj-$(CONFIG_COVERAGE) += coverage/ obj-y += sched/ obj-$(CONFIG_UBSAN) += ubsan/
xen/common/symbols-dummy.c deleted +0 -24
@@ -1,24 +0,0 @@ -/* -* symbols-dummy.c: dummy symbol-table definitions for the inital partial -* link of the hypervisor image. -*/ - -#include "symbols.h" - -#ifdef SYMBOLS_ORIGIN -const unsigned int symbols_offsets[1 ]; -#else -const unsigned long symbols_addresses[1 ]; -#endif -const unsigned int symbols_num_addrs; -const unsigned char symbols_names[1 ]; - -#ifdef CONFIG_FAST_SYMBOL_LOOKUP -const unsigned int symbols_num_names; -const struct symbol_offset symbols_sorted_offsets[1 ]; -#endif - -const uint8_t symbols_token_table[1 ]; -const uint16_t symbols_token_index[1 ]; - -const unsigned int symbols_markers[1 ];
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
Quoted 3 lines · Jan Beulich
No architecture using it anymore, we can as well get rid of it.
Signed-off-by Jan Beulich <[email protected]>
Quoted 3 lines
---
Should we also dropcommon/symbols.hagain then, by moving its contents back intocommon/symbols.c?
Probably.
~Andrew
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
In reply to Jan BeulichQuoted 36 lines · Jan Beulich
No architecture using it anymore, we can as well get rid of it.
Signed-off-by Jan Beulich <[email protected]>---
Should we also dropcommon/symbols.hagain then, by moving its contents back intocommon/symbols.c?xen/common/Makefile +0
-2@@ -74,8 +74,6 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) obj-y += domctl.o endif -extra-y := symbols-dummy.o - obj-$(CONFIG_COVERAGE) += coverage/ obj-y += sched/ obj-$(CONFIG_UBSAN) += ubsan/xen/common/symbols-dummy.c deleted +0
-14@@ -1,24 +0,0 @@ -/* -* symbols-dummy.c: dummy symbol-table definitions for the inital partial -* link of the hypervisor image. -*/ - -#include "symbols.h" - -#ifdef SYMBOLS_ORIGIN -const unsigned int symbols_offsets[1 ]; -#else -const unsigned long symbols_addresses[1 ]; -#endif -const unsigned int symbols_num_addrs; -const unsigned char symbols_names[1 ];
xen/common/symbols-dummy.c line 24
Quoted 10 lines
xen/common/symbols-dummy.c deleted +0
-10- -#ifdef CONFIG_FAST_SYMBOL_LOOKUP -const unsigned int symbols_num_names; -const struct symbol_offset symbols_sorted_offsets[1 ]; -#endif - -const uint8_t symbols_token_table[1 ]; -const uint16_t symbols_token_index[1 ]; - -const unsigned int symbols_markers[1 ];
Now this is (to me at least) absurd: I'm removing a file, just to find the pipeline fails because cppcheck doesn't like docs/misra/exclude-list.json containing a reference to a non-existing file.
I'll amend the commit with
docs/misra/exclude-list.json +0 -4
@@ -170,10 +170,6 @@ "comment": "Imported from Linux, ignore for now" }, { - "rel_path": "common/symbols-dummy.c", - "comment": "The resulting code is not included in the final Xen binary, ignore for now" - }, - { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README.source" },
but I think such tidying should be optional.
Jan
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
Hi Jan,
Quoted 70 lines · Jan Beulich
Quoted 36 lines · Jan Beulich
No architecture using it anymore, we can as well get rid of it.
Signed-off-by Jan Beulich <[email protected]>---
Should we also dropcommon/symbols.hagain then, by moving its contents back intocommon/symbols.c?xen/common/Makefile +0
-0@@ -74,8 +74,6 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)obj-y += domctl.o
endifxen/common/Makefile +0
-2-extra-y := symbols-dummy.o -obj-$(CONFIG_COVERAGE) += coverage/
obj-y += sched/
obj-$(CONFIG_UBSAN) += ubsan/xen/common/symbols-dummy.c deleted +0
-14@@ -1,24 +0,0 @@ -/* -* symbols-dummy.c: dummy symbol-table definitions for the inital partial -* link of the hypervisor image. -*/ - -#include "symbols.h" - -#ifdef SYMBOLS_ORIGIN -const unsigned int symbols_offsets[1 ]; -#else -const unsigned long symbols_addresses[1 ]; -#endif -const unsigned int symbols_num_addrs; -const unsigned char symbols_names[1 ];xen/common/symbols-dummy.c line 24
Quoted 10 lines
xen/common/symbols-dummy.c deleted +0
-10- -#ifdef CONFIG_FAST_SYMBOL_LOOKUP -const unsigned int symbols_num_names; -const struct symbol_offset symbols_sorted_offsets[1 ]; -#endif - -const uint8_t symbols_token_table[1 ]; -const uint16_t symbols_token_index[1 ]; - -const unsigned int symbols_markers[1 ];Now this is (to me at least) absurd: I'm removing a file, just to find the pipeline fails because cppcheck doesn't like
docs/misra/exclude-list.jsoncontaining a reference to a non-existing file.I'll amend the commit with
docs/misra/exclude-list.json +0
-4@@ -170,10 +170,6 @@ "comment": "Imported from Linux, ignore for now" }, { - "rel_path": "common/symbols-dummy.c", - "comment": "The resulting code is not included in the final Xen binary, ignore for now" - }, - { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README.source" },
Quoted 3 lines
but I think such tidying should be optional.
Jan
Can you share the error?
Cheers,
Luca
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
Quoted 72 lines · Luca Fancellu
Hi Jan,
Quoted 70 lines · Jan Beulich
Quoted 36 lines · Jan Beulich
No architecture using it anymore, we can as well get rid of it.
Signed-off-by Jan Beulich <[email protected]>---
Should we also dropcommon/symbols.hagain then, by moving its contents back intocommon/symbols.c?xen/common/Makefile +0
-0@@ -74,8 +74,6 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)obj-y += domctl.o
endifxen/common/Makefile +0
-2-extra-y := symbols-dummy.o -obj-$(CONFIG_COVERAGE) += coverage/
obj-y += sched/
obj-$(CONFIG_UBSAN) += ubsan/xen/common/symbols-dummy.c deleted +0
-14@@ -1,24 +0,0 @@ -/* -* symbols-dummy.c: dummy symbol-table definitions for the inital partial -* link of the hypervisor image. -*/ - -#include "symbols.h" - -#ifdef SYMBOLS_ORIGIN -const unsigned int symbols_offsets[1 ]; -#else -const unsigned long symbols_addresses[1 ]; -#endif -const unsigned int symbols_num_addrs; -const unsigned char symbols_names[1 ];xen/common/symbols-dummy.c line 24
Quoted 10 lines
xen/common/symbols-dummy.c deleted +0
-10- -#ifdef CONFIG_FAST_SYMBOL_LOOKUP -const unsigned int symbols_num_names; -const struct symbol_offset symbols_sorted_offsets[1 ]; -#endif - -const uint8_t symbols_token_table[1 ]; -const uint16_t symbols_token_index[1 ]; - -const unsigned int symbols_markers[1 ];Now this is (to me at least) absurd: I'm removing a file, just to find the pipeline fails because cppcheck doesn't like
docs/misra/exclude-list.jsoncontaining a reference to a non-existing file.I'll amend the commit with
docs/misra/exclude-list.json +0
-4@@ -170,10 +170,6 @@ "comment": "Imported from Linux, ignore for now" }, { - "rel_path": "common/symbols-dummy.c", - "comment": "The resulting code is not included in the final Xen binary, ignore for now" - }, - { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README.source" },
Quoted 3 lines
Quoted 1 line
but I think such tidying should be optional.
Can you share the error?
+ xen/scripts/xen-analysis.py --run-cppcheck --cppcheck-misra -- -j16
ERROR: Issue with reading file /builds/xen-project/hardware/xen-staging/docs/misra/exclude-list.json: Malformed path: common/symbols-dummy.c refers to /builds/xen-project/hardware/xen-staging/xen/common/symbols-dummy.c that does not exists
Jan
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
Hi Jan,
Quoted 22 lines
Quoted 22 lines
Quoted 22 lines
Quoted 1 line
Now this is (to me at least) absurd: I'm removing a file, just to find the pipeline fails because cppcheck doesn't like
docs/misra/exclude-list.jsoncontaining a reference to a non-existing file.I'll amend the commit with
docs/misra/exclude-list.json +0
-4@@ -170,10 +170,6 @@ "comment": "Imported from Linux, ignore for now" }, { - "rel_path": "common/symbols-dummy.c", - "comment": "The resulting code is not included in the final Xen binary, ignore for now" - }, - { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README.source" },
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
but I think such tidying should be optional.
Can you share the error?
+
xen/scripts/xen-analysis.py--run-cppcheck --cppcheck-misra -- -j16
ERROR: Issue with reading file /builds/xen-project/hardware/xen-staging/docs/misra/exclude-list.json: Malformed path:common/symbols-dummy.crefers to /builds/xen-project/hardware/xen-staging/xen/common/symbols-dummy.c that does not exists
Oh ok I see, seems to me a good feedback from the tool to keep everything consistent.
Cheers,
Luca
Re: [PATCH 7/8] symbols: drop symbols-dummy.c
Quoted 20 lines · Luca Fancellu
Quoted 20 lines
Quoted 20 lines
Quoted 20 lines
Now this is (to me at least) absurd: I'm removing a file, just to find the pipeline fails because cppcheck doesn't like
docs/misra/exclude-list.jsoncontaining a reference to a non-existing file.I'll amend the commit with
docs/misra/exclude-list.json +0
-4@@ -170,10 +170,6 @@ "comment": "Imported from Linux, ignore for now" }, { - "rel_path": "common/symbols-dummy.c", - "comment": "The resulting code is not included in the final Xen binary, ignore for now" - }, - { "rel_path": "crypto/*", "comment": "Origin is external and documented in crypto/README.source" },
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
but I think such tidying should be optional.
Can you share the error?
+
xen/scripts/xen-analysis.py--run-cppcheck --cppcheck-misra -- -j16
ERROR: Issue with reading file /builds/xen-project/hardware/xen-staging/docs/misra/exclude-list.json: Malformed path:common/symbols-dummy.crefers to /builds/xen-project/hardware/xen-staging/xen/common/symbols-dummy.c that does not existsOh ok I see, seems to me a good feedback from the tool to keep everything consistent.
Well. If I remove a file from the xen/ subtree, then seeing empty grep output on that subtree should allow me to be sufficiently sure that no problematic (as in: breaking the build) references have survived.
Plus while I agree that consistency is desirable to have here, is a stale file ref really a reason to cause a build to fail? Wouldn't a warning suffice?
How many tools' behaviors can we (as developers, reviewers, and committers) keep in mind when putting together otherwise simple changes?
Jan
PATCH 8/8 symbols: check table sizes don't change between linking passes 2 and 3
In reply to Jan BeulichWhile sizes (and possibly positions) of the symbol table related symbols (and as a result other ones) are expected to change from linking pass 1 to pass 2, no such change should happen anymore from pass 2 to pass 3, or else the internally recorded symbol table wouldn't represent the ELF or PE/COFF ones.
For comparing to be actually useful, i.e. most notably also covering the last of the arrays emitted, symbol sizes need establishing. Make use of the xen/linkage.h machinery to achieve that.
---
Likely other ports also want to add such checking. Really it would be nice if we could properly abstract out shared parts of the linking steps.
RFC: I'm all ears towards improvement suggestions in the temporary helper
file handling of compare-symbol-tables. Or ideally some approach to avoid the use of a helper file altogether.
---
v1': Re-base over the re-numbering of intermediate files. Integrate into
series.
xen/arch/x86/Makefile +3 -0
@@ -148,6 +148,7 @@ $(TARGET)-syms: $(objtree)/prelink.o $(o | $(objtree)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \ > $(dot-target).2.S $(MAKE) $(build)=$(@D) $(dot-target).2.o + $(call compare-symbol-tables, $(dot-target).1.o, $(dot-target).2.o) $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $< $(build_id_linker) \ $(orphan-handling-y) $(dot-target).2.o -o $@ $(NM) -pa --format=sysv $@ \
@@ -230,6 +231,8 @@ endif | $(objtree)/tools/symbols $(all_symbols) --sysv --sort \ > $(dot-target).2s.S $(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o + $(call compare-symbol-tables, $(dot-target).1r.o, $(dot-target).2r.o) + $(call compare-symbol-tables, $(dot-target).1s.o, $(dot-target).2s.o) $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \ $(dot-target).2r.o $(dot-target).2s.o $(orphan-handling-y) \ $(note_file_option) -o $@
xen/scripts/Kbuild.include +13 -0
@@ -56,6 +56,19 @@ define filechk fi endef +### +# Compare the symbol tables of two object files. As diff's -I option isn't +# standardized, the name difference of the two object files needs abstracting +# out. +define compare-symbol-tables + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \ + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \ + rm -f $(@D)/.cst.$$$$ + diff -u $(1).sym $(2).sym +endef + # as-insn: Check whether assembler supports an instruction. # Usage: cflags-y += $(call as-insn,CC FLAGS,"insn",option-yes,option-no) as-insn = $(if $(shell echo 'void _(void) { asm volatile ( $(2) ); }' \
xen/tools/symbols.c +43 -46
148 lines not on this page · raw message
Re: [PATCH v1' 8/8] symbols: check table sizes don't change between linking passes 2 and 3
Quoted 6 lines · Jan Beulich
xen/scripts/Kbuild.include +0
-0@@ -56,6 +56,19 @@ define filechk fi endef
xen/scripts/Kbuild.include define filechk · line 68
Quoted 10 lines
xen/scripts/Kbuild.include +10
-0+### +# Compare the symbol tables of two object files. As diff's -I option isn't +# standardized, the name difference of the two object files needs abstracting +# out. +define compare-symbol-tables + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \ + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \ + rm -f $(@D)/.cst.$$$$
Doesn't the second link want to be ln -f $(2) ?
It looks like this is comparing $(1) to itself.
xen/scripts/Kbuild.include define filechk · line 70
Quoted 2 lines
xen/scripts/Kbuild.include +2
-0+ diff -u $(1).sym $(2).sym +endef
While I am generally in favour of build time checks, this looks like it's a large overhead?
~Andrew
Re: [PATCH v1' 8/8] symbols: check table sizes don't change between linking passes 2 and 3
Quoted 20 lines · Andrew Cooper
Quoted 6 lines · Jan Beulich
xen/scripts/Kbuild.include +0
-0@@ -56,6 +56,19 @@ define filechk fi endefxen/scripts/Kbuild.include define filechk · line 68
Quoted 10 lines
xen/scripts/Kbuild.include +10
-0+### +# Compare the symbol tables of two object files. As diff's -I option isn't +# standardized, the name difference of the two object files needs abstracting +# out. +define compare-symbol-tables + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(1).sym; \ + ln -f $(1) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \ + rm -f $(@D)/.cst.$$$$Doesn't the second link want to be
ln -f $(2)?
Quoted 1 line
It looks like this is comparing $(1) to itself.
Ouch. Now I'll be curious if with this corrected I still see this pass successfully.
Quoted 5 lines
xen/scripts/Kbuild.include define filechk · line 70
Quoted 2 lines
xen/scripts/Kbuild.include +2
-0+ diff -u $(1).sym $(2).sym +endefWhile I am generally in favour of build time checks, this looks like it's a large overhead?
I don't think it's really noticeable in the overall link time, considering how slow especially the xen.efi linking is.
Jan