Pages: [1]   Go Down
Author Topic: Arduino IDE hex file size  (Read 583 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
  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?

Con
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 37
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Cheers,
Con
Logged

Ayer, Massachusetts, USA
Offline Offline
Edison Member
*
Karma: 54
Posts: 1848
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: