diff options
| author | Tom Rini <[email protected]> | 2026-01-26 11:19:22 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-01-26 11:19:22 -0600 |
| commit | dc2d8423b19d30472b02e02b41504226908a4291 (patch) | |
| tree | 2ff7741ad805e7b59077af8d0f8c0a20d0137b0f /scripts/Makefile.xpl | |
| parent | f4dfa5d3c2680322fd17fcc7c6221876e00a03c2 (diff) | |
count rel_dyn
Signed-off-by: Tom Rini <[email protected]>
Diffstat (limited to 'scripts/Makefile.xpl')
| -rw-r--r-- | scripts/Makefile.xpl | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/scripts/Makefile.xpl b/scripts/Makefile.xpl index 5e65d7b2498..1be0057e6b8 100644 --- a/scripts/Makefile.xpl +++ b/scripts/Makefile.xpl @@ -343,8 +343,17 @@ $(obj)/$(SPL_BIN).bin: $(obj)/$(SPL_BIN)-nodtb.bin FORCE endif # Create a file that pads from the end of u-boot-spl-nodtb.bin to bss_end -$(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN) - @bss_size_str=$(shell $(NM) $< | awk 'BEGIN {size = 0} /__bss_size/ {size = $$1} END {print "ibase=16; " toupper(size)}' | bc); \ +$(obj)/$(SPL_BIN)-pad.bin: $(obj)/$(SPL_BIN)-nodtb.bin + bss_size_str=$(shell cat $(obj)/$(SPL_BIN).map | \ + awk ' \ + /__rel_dyn_start/ { start = $$1 } \ + /__rel_dyn_end/ { end = $$1 } \ + /__bss_size/ { size = $$1 } \ + END { \ + if (start != "" && end != "" && size != "") \ + print end " " start " " size; \ + }' \ + | sh -c 'read end start size && echo $$(( size - (end - start) ))'); \ dd if=/dev/zero of=$@ bs=1 count=$${bss_size_str} 2>/dev/null; $(obj)/$(SPL_BIN).dtb: $(obj)/dts/dt-$(SPL_NAME).dtb FORCE |
