From 4e7f4cac4bc088d8bccea146a5547de1fde453ec Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Tue, 2 Nov 2021 09:47:14 +0000 Subject: Accurate sizes This include the init code itself (GSINIT and GSFINAL sections), besides the size of the initialized data. --- tools/chksize | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'tools/chksize') diff --git a/tools/chksize b/tools/chksize index 0be40b4..8b88560 100755 --- a/tools/chksize +++ b/tools/chksize @@ -8,7 +8,8 @@ def main(): sys.exit("usage: %s code_limit_hex data_limit_hex filename.map" % sys.argv[0]) - sizes = {"CODE": 0, "DATA": 0, "INITIALIZED": 0} + sizes = {"CODE": 0, "DATA": 0, + "INITIALIZER": 0, "GSINIT": 0, "GSFINAL": 0} with open(sys.argv[3], "r") as fd: for line in fd.readlines(): @@ -16,10 +17,11 @@ def main(): if "l__%s" % seg in line: sizes[seg] = int(line.split()[0], base=16) - sizes["ROM"] = sizes["CODE"] + sizes["INITIALIZED"] + sizes["INIT"] = sizes["INITIALIZER"] + sizes["GSINIT"] + sizes["GSFINAL"] + sizes["ROM"] = sizes["CODE"] + sizes["INIT"] print("\nROM: CODE %(CODE)05d bytes\n" - " INIT %(INITIALIZED)05d bytes\n" + " INIT %(INIT)05d bytes\n" " Total %(ROM)05d bytes\n" "RAM: %(DATA)05d bytes\n" % sizes) -- cgit v1.2.3