Skip to contentSkip to conversation

Add additional symbols to xen-syms.map

PATCH Superseded Michael Kurth 2 participants 4 messages Aug 21, 2020 – Sep 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add additional symbols to xen-syms.map

From: Michael Kurth <[email protected]>

Add "all_symbols" to all /tools/symbols calls so that xen-syms.map lists all symbols and not only .text section symbols. This change enhances debugging and livepatch capabilities.

---
 xen/arch/arm/Makefile | 2 +-
 xen/arch/x86/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/Makefile +1 -1
index 7e82b2178c..bab0646204 100644
@@ -115,7 +115,7 @@ $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).1.o -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort \
+		| $(BASEDIR)/tools/symbols $(all_symbols) --xensyms --sysv --sort \
 		>$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]*
 
xen/arch/x86/Makefile +2 -2
index b388861679..efbe2f80b6 100644
@@ -153,7 +153,7 @@ $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).1.o -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort \
+		| $(BASEDIR)/tools/symbols $(all_symbols) --xensyms --sysv --sort \
 		>$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
 
@@ -215,7 +215,7 @@ $(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o efi/mkreloc
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort >$(@D)/$(@F).map
+		| $(BASEDIR)/tools/symbols $(all_symbols) --xensyms --sysv --sort >$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
 else
 $(TARGET).efi: FORCE
Signature · 12 lines
2.16.6




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
#1 lore raw
Quoted 6 lines · Michael Kurth

From: Michael Kurth <[email protected]>

Add "all_symbols" to all /tools/symbols calls so that xen-syms.map lists all symbols and not only .text section symbols. This change enhances debugging and livepatch capabilities.

With

ifdef CONFIG_LIVEPATCH
all_symbols = --all-symbols
ifdef CONFIG_FAST_SYMBOL_LOOKUP
all_symbols = --all-symbols --sort-by-name
endif
else
all_symbols =
endif

I agree this helps the CONFIG_LIVEPATCH case, but I doubt you really want --sort-by-name here, and to also cover debugging (as you say) imo you want --all-symbols, not $(all_symbols) in the places that you change.

Further, seeing that the places you change are exactly all the ones using --xensyms, I wonder whether the tool shouldn't imply --all-symbols from --xensyms.

Jan

#2 lore raw

PATCH v2 1/1 Add additional symbols to xen-syms.map

In reply to Michael Kurth

From: Michael Kurth <[email protected]>

Add "all_symbols" to all /tools/symbols calls so that xen-syms.map lists all symbols and not only .text section symbols. This change enhances debugging and livepatch capabilities.

---
 xen/arch/arm/Makefile | 2 +-
 xen/arch/x86/Makefile | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
xen/arch/arm/Makefile +1 -1
index 7e82b2178c..51173d9712 100644
@@ -115,7 +115,7 @@ $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).1.o -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort \
+		| $(BASEDIR)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		>$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]*
 
xen/arch/x86/Makefile +2 -2
index b388861679..14a05b09bc 100644
@@ -153,7 +153,7 @@ $(TARGET)-syms: prelink.o xen.lds
 	$(LD) $(XEN_LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).1.o -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort \
+		| $(BASEDIR)/tools/symbols --all-symbols --xensyms --sysv --sort \
 		>$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
 
@@ -215,7 +215,7 @@ $(TARGET).efi: prelink-efi.o $(note_file) efi.lds efi/relocs-dummy.o efi/mkreloc
 	$(LD) $(call EFI_LDFLAGS,$(VIRT_BASE)) -T efi.lds -N $< \
 	                $(@D)/.$(@F).1r.o $(@D)/.$(@F).1s.o $(note_file_option) -o $@
 	$(NM) -pa --format=sysv $(@D)/$(@F) \
-		| $(BASEDIR)/tools/symbols --xensyms --sysv --sort >$(@D)/$(@F).map
+		| $(BASEDIR)/tools/symbols --all-symbols --xensyms --sysv --sort >$(@D)/$(@F).map
 	rm -f $(@D)/.$(@F).[0-9]* $(@D)/..$(@F).[0-9]*
 else
 $(TARGET).efi: FORCE
Signature · 12 lines
2.16.6




Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
Acked-by on v2 1/1
#3 lore raw
Quoted 7 lines · Michael Kurth

From: Michael Kurth <[email protected]>

Add "all_symbols" to all /tools/symbols calls so that xen-syms.map lists all symbols and not only .text section symbols. This change enhances debugging and livepatch capabilities.

Quoted 5 lines