From 06438aead654bb53dc500a1a7b69a38c845a895d Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 22 Sep 2026 09:20:55 +0200 Subject: [PATCH] build: move $(compare-symbol-tables) With the final linking logic now consolidated in scripts/Makefile.link, $(compare-symbol-tables) also doesn't need setting anymore in Kbuild.include. Signed-off-by: Jan Beulich Reviewed-by: Anthony PERARD --- xen/scripts/Kbuild.include | 13 ------------- xen/scripts/Makefile.link | 12 ++++++++++++ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/xen/scripts/Kbuild.include b/xen/scripts/Kbuild.include index 41483513ac..c2e4ec811b 100644 --- a/xen/scripts/Kbuild.include +++ b/xen/scripts/Kbuild.include @@ -56,19 +56,6 @@ 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 $(2) $(@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) ); }' \ diff --git a/xen/scripts/Makefile.link b/xen/scripts/Makefile.link index 11d3fc48da..dda38da2c3 100644 --- a/xen/scripts/Makefile.link +++ b/xen/scripts/Makefile.link @@ -33,6 +33,18 @@ final-image-check-y ?= true $(if $(filter $(LAST_LINKING_PASS),$*), $(syms-warn-dup-y)) \ > $@ +# 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 $(2) $(@D)/.cst.$$$$; \ + $(OBJDUMP) -t $(@D)/.cst.$$$$ > $(2).sym; \ + rm -f $(@D)/.cst.$$$$; \ + diff -u $(1).sym $(2).sym +endef + .$(TARGET)-syms.%: $(objtree)/prelink.o .$(TARGET)-syms.%.o $(obj)/xen.lds $(LD) $(XEN_LDFLAGS) -T $(obj)/xen.lds $(filter %.o,$^) \ $(build_id_linker) --strip-debug -o $@