]> xenbits.xensource.com Git - people/jgross/xen.git/commitdiff
build: correctly report non-empty section sizes upon .o -> .init.o conversion
authorJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 11:12:21 +0000 (13:12 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 7 Aug 2020 11:12:21 +0000 (13:12 +0200)
The originally used sed expression converted not just multiple leading
zeroes (as intended), but also trailing ones, rendering the error
message somewhat confusing. Collapse zeroes in just the one place where
we need them collapsed, and leave objdump's output as is for all other
purposes.

Fixes: 48115d14743e ("Move more kernel decompression bits to .init.* sections")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/Rules.mk

index 62e9fabe7ad8f4432baabd681835303488ba624e..e90a03d1164788de56a78fcb24c2b3480932e020 100644 (file)
@@ -185,11 +185,11 @@ cmd_cc_o_S = $(CC) $(a_flags) -c $< -o $@
 
 quiet_cmd_obj_init_o = INIT_O  $@
 define cmd_obj_init_o
-    $(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p;}' | while read idx name sz rest; do \
+    $(OBJDUMP) -h $< | while read idx name sz rest; do \
         case "$$name" in \
         .*.local) ;; \
         .text|.text.*|.data|.data.*|.bss) \
-            test $$sz != 0 || continue; \
+            test $$(echo $$sz | sed 's,00*,0,') != 0 || continue; \
             echo "Error: size of $<:$$name is 0x$$sz" >&2; \
             exit $$(expr $$idx + 1);; \
         esac; \