From: Jan Beulich Date: Fri, 7 Aug 2020 11:12:21 +0000 (+0200) Subject: build: correctly report non-empty section sizes upon .o -> .init.o conversion X-Git-Tag: archive/raspbian/4.16.0+51-g0941d6cb-1+rpi1~2^2~42^2~1784 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=d87c5166daee1f9e1570961b2d204a4a2570acf5;p=xen.git build: correctly report non-empty section sizes upon .o -> .init.o conversion 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 Acked-by: Andrew Cooper --- diff --git a/xen/Rules.mk b/xen/Rules.mk index 62e9fabe7a..e90a03d116 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -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; \