Go Down

Topic: Arduino IDE hex file size (Read 632 times) previous topic - next topic


  I'm using eclipse to compile code for the Yun. Using verbose mode in the actual Arduino IDE I've captured most of the build commands and options, and set them up in eclipse. But... My final program size for a trivial hello program is 18k, but in the IDE it's only 4k. The elf files are more or less the same size. I have set eclipse to generate a listing file, where I can see the .text
Section is indeed 18k.

Before I go much further, and try to coax a listing file out of the IDE, does anyone know of any obvious reason why the two output images might differ so much in size?



Are you sure you used the -fdata-sections and -ffunction-sections on ALL compilations, including things in the library?  And passed the -Wl,--gc-sections to the linker?  These options delete functions and global data that are unused in your program.

In addition, make sure the same optimization flags are used.  I think Arduino tends to use -Os, but I may be mis-remembering.


Hi Micahel,
   many thanks for replying. You pointed me in the right direction. It was a problem with Linker flags. I had noted all of the flags that the Ardiono IDE uses for linking, including -gc-sections, but the Eclipse IDE was arranging all of the flags in it's own merry way. I dumped the various Eclipse input panels for linking, and hard coded a set of flags on the "Export mode" setting. I am now getting the same output images from Eclipse as from the Arduino.



Great, I'm glad it was simple to fix.

Go Up

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

shortcuts: alt+s submit/post or alt+p preview