diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 9d07a0a0d6..269a1a3acb 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -208,7 +208,8 @@ $(TARGET).efi: $(objtree)/prelink.o $(note_file) $(obj)/efi.lds $(obj)/efi/reloc 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) \ @@ -218,6 +219,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), \ @@ -228,6 +230,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 $(MAKE) $(build)=$(@D) .$(@F).2r.o .$(@F).2s.o $(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T $(obj)/efi.lds $< \ diff --git a/xen/tools/symbols.c b/xen/tools/symbols.c index 509394d5a4..bc50b1a576 100644 --- a/xen/tools/symbols.c +++ b/xen/tools/symbols.c @@ -66,6 +66,7 @@ int token_profit[0x10000]; unsigned char best_table[256][2]; unsigned char best_table_len[256]; +static const char *srcname = "xen-syms.S"; static void usage(void) { @@ -347,6 +348,7 @@ static void write_src(void) printf("#define ALGN .balign 4\n"); printf("#endif\n"); + printf("\t.file \"%s\"\n", srcname); printf("\t.section .rodata, \"a\"\n"); printf("#ifndef SYMBOLS_ORIGIN\n"); @@ -682,6 +684,8 @@ int main(int argc, char **argv) unsorted = true; else if (strcmp(argv[i], "--sort-by-name") == 0) sort_by_name = 1; + else if (strncmp(argv[i], "--source-name=", 14) == 0) + srcname = argv[i] + 14; else if (strcmp(argv[i], "--warn-dup") == 0) warn_dup = true; else if (strcmp(argv[i], "--error-dup") == 0)