5 ms·
I actually built it. It's a whooooole lot bigger than 45 KB. It's bigger than a 1.44 MB floppy. bruce@rip:~/riscv/egos/egos-2000/build/release$ size -t *
by brucehoult 3y ago
I actually built it. It's a whooooole lot bigger than 45 KB. It's bigger than a 1.44 MB floppy.
bruce@rip:~/riscv/egos/egos-2000/build/release$ size -t *
text data bss dec hex filename
1552 8 3076 4636 121c cat.elf
2232 8 3076 5316 14c4 cd.elf
1440 1076 2048 4564 11d4 clock.elf
3692 2120 2104 7916 1eec crash1.elf
424 8 2048 2480 9b0 crash2.elf
4294256 2496 3400 4300152 419d78 earth.elf
224 8 2048 2280 8e8 echo.elf
7144 12 2380 9536 2540 grass.elf
1136 8 3076 4220 107c ls.elf
156 8 2048 2212 8a4 pwd.elf
2928 1076 3076 7080 1ba8 sys_dir.elf
7972 2120 2132 12224 2fc0 sys_file.elf
4340 24 3088 7452 1d1c sys_proc.elf
1736 8 2048 3792 ed0 sys_shell.elf
188 8 2048 2244 8c4 ult.elf
4329420 8988 37696 4376104 42c628 (TOTALS)
I'm not sure how the heck earth.elf text section is 4 MB. Sure, it's got a ton of libgcc stuff (e.g. mul/dev emulation) and libc stuff (e.g. big printf stuff). But it gzips to 100k and objdump shows 23676 instructions, which is 94704 bytes. Hex dumping the file, earth.elf is full of 0s from 0x1a9d0 to 0x4ab000 which is 4785712 bytes.
Changing the ISA in the makefile from RV32I to RV32IMAC reduces all the text sizes except earth.elf by 20% to 30%, as expected.
text data bss dec hex filename
1224 8 3076 4308 10d4 cat.elf
1694 8 3076 4778 12aa cd.elf
868 1076 2048 3992 f98 clock.elf
2712 2120 2104 6936 1b18 crash1.elf
324 8 2048 2380 94c crash2.elf
4264910 2496 3400 4270806 412ad6 earth.elf
164 8 2048 2220 8ac echo.elf
5346 12 2380 7738 1e3a grass.elf
928 8 3076 4012 fac ls.elf
110 8 2048 2166 876 pwd.elf
2066 1076 3076 6218 184a sys_dir.elf
6074 2120 2132 10326 2856 sys_file.elf
3474 24 3088 6586 19ba sys_proc.elf
1350 8 2048 3406 d4e sys_shell.elf
146 8 2048 2202 89a ult.elf
4291390 8988 37696 4338074 42319a (TOTALS)
- MichaelZuo 3y agoearth.elf might be a spurious file?