ld: Print 0 size in B and not in GB

When using --print-memory-usage, the printed size can be zero and in
that case, the unit should be B and not GB.

ld/
	* ldlang.c (lang_print_memory_size) Print 0 B instead of 0 GB.
	* testsuite/ld-scripts/print-memory-usage-1.l: Validate emplty region.
	* testsuite/ld-scripts/print-memory-usage-1.t: Define empty region.

Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
This commit is contained in:
Torbjörn SVENSSON
2023-12-17 22:16:08 +01:00
committed by Nick Clifton
parent 4cc1f41cfa
commit 8ea1e363b9
3 changed files with 5 additions and 1 deletions

View File

@@ -2,4 +2,5 @@ MEMORY
{
ROM (RX) : ORIGIN = 0x1000, LENGTH = 1K
RAM (W) : ORIGIN = 0x100000, LENGTH = 256K
FOO (RX) : ORIGIN = 0x100, LENGTH = 1K
}