> S19 file from an executable is 260kB and the ELF is only 60KB.
> btw, i guess i mistakenly thought elf is smaller footprint.. it's actually a lot bigger than s19.
It contains all of the information that your debugger uses.
942304 Mar 8 17:32 main.bin* 2709166 Mar 8 17:32 main.hex* 3175453 Mar 8 17:32 main.elf*
Do you have a "size" command to give something like:
$ m68k-elf-size *.elf text data bss dec hex filename 516128 426176 936184 1878488 1ca9d8 main.elf 126048 35904 79036 240988 3ad5c boot.elf 19936 1088 2388 23412 5b74 memtest.elf
The "text" is the program code. The "data" is all initialised data in the project. The "bss" is all of the uninitialised data. The code takes "text + data" in FLASH, but "text + data + bss" in RAM, plus the stack and heap space.
You should have a close look at the "data" section. It might be a lot bigger than it needs to be. You might have a lot of statically initialised arrays or structures in your project. Depending on how smart the development environment is, these might generate huge blocks of zeros (dumb system) or in a smarter system may be compressed and expanded by initialisation code. Zero blocks get compressed down to almost nothing in these systems. What is your one doing?
Open your S19 file in an editor and see if there are large blocks of zero data in there. If there are, thenyou should be able to use the MAP file to convert the addresses in the S19 files back to the variable that are to blame.Then you can find them in the code (usually asking "why did I do something that stupid?"). You might even find large structures that you aren't even using any more or that don't need to be as big as they are.
If you do have some of these you can make your binary smaller (sometimes a lot smaller) by removing the static initialisation and writing a few lines of code to initialise these arrays and structures. This moves the data from "data" (which you have to store in FLASH) to "bss" (which you don't).
Tom