nicksen782 wrote:That "avr-nm" part will show you what is using .text and .bss (sizes of functions and arrays and such) which helps to figure out functions that you could likely see benefit in optimizing for size.
Ah very nice, that is actually very handy! Will definitely have to use that going forward, as I do generally experiment towards the end to find the smallest design for each function. My normal method was working on 1 function at a time and recompiling to check the difference, but it would be very nice just to see a quick overview of everything, which would dictate where to spend the most optimization time.
nicksen782 wrote:What does the Makefile for Megatris and the SuperMarioDemo look like?
Looks like they are also the cryptic version, almost everything is.
I guess all the current standard does is repeat what is already in the (GAME).lss, like:
Code: Select all
//first lines of (GAME).lss
ZoomingSecretary.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000926 00800100 0000a8c0 0000aa00 2**8
CONTENTS, ALLOC, LOAD, DATA
1 .text 0000a8c0 00000000 00000000 00000100 2**8
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .bss 000002a2 00800a26 00800a26 0000b326 2**1
ALLOC
3 .comment 00000011 00000000 00000000 0000b326 2**0
CONTENTS, READONLY
4 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 0000b338 2**2
CONTENTS, READONLY
5 .debug_aranges 00000580 00000000 00000000 0000b378 2**3
CONTENTS, READONLY, DEBUGGING
6 .debug_info 00007cd5 00000000 00000000 0000b8f8 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 00000ee7 00000000 00000000 000135cd 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 000056f8 00000000 00000000 000144b4 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_frame 00000d2c 00000000 00000000 00019bac 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_str 000020b2 00000000 00000000 0001a8d8 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_loc 00005e02 00000000 00000000 0001c98a 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_ranges 00000740 00000000 00000000 00022790 2**3
CONTENTS, READONLY, DEBUGGING
Which I could understand maybe when you are doing radical stuff like Jubatian and Cunning do, but even then I wonder how often that is more important that just plain old flash and ram usage. At least if someone wanted to work on an existing demo, they are probably watching as their flash and ram usage increase with more features.
I guess it is non-critical to update all the demos to show this(though I think it would be worth doing). Going forward I guess I will do the latter method I mentioned, or what nicksen782 has just mentioned. I have to think the only reason the current method is all over the place, is like you say just copying an existing makefile.