-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The printed total size differs from calculated from .json #33967
Comments
One reason for this is because the size report itself will take the rom_start, datas and devices sections into consideration, which means the final size reported:
will be larger than the sum of the sizes of the individual symbols. When you sum the json, it is the sum of the size of each symbol, but the If you compare to
Note, the section list above is not necessarily complete. |
The sizes of individual items are of the items themselves, while the total size takes into account of alignments and padding. That's why the total size is larger. And one important thing to remember, not all symbols are itemized. There are symbols in the image (for example, strings) that do not appear in the symbol table, and thus not in the list but counted towards total size. |
@wangnuannuan any updates on this |
Describe the bug
I want to get the rom and ram size by reading the JSON file, so I use the script https:/zephyrproject-rtos/zephyr/blob/master/scripts/footprint/size_report to parse the elf file.
Take rom size as example, the script will print the total size in the terminal and generate a file
rom.json
. But when I use the following code to calculate the rom size in the JSON file, the printed total size differs from calculated from JSON file.@dcpleung @nashif
The text was updated successfully, but these errors were encountered: