This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Programs Image Size



On 20-Jul-2000 Fabrice Gautier wrote:
> Hi,
> 
> When building the examples in the eCos/examples directory, with a default
> ARM PID board configuration, the resulting .exe images are about 1 Meg in
> size. However when downloading to the board the downloaded size is only
> about 40Ko. Why is there such a difference? What are in the .exe images? And
> how can I evaluate the "real" size?
> 

The executable image will contain information used by GDB and/or Insight
for debugging purposes.  Since this information must represent the program
in it's entirety, you can imagine it might be large.

If you want to see how big a program is, try using "size" or "objdump".
E.g.
[gary@hermes edb7212_test]$ arm-elf-size install/tests/kernel/current/tests/tm_basic 
   text    data     bss     dec     hex filename
  43184    5360 5798192 5846736  5936d0 install/tests/kernel/current/tests/tm_basic

[gary@hermes edb7212_test]$ arm-elf-objdump -h install/tests/kernel/current/tests/tm_basic 

install/tests/kernel/current/tests/tm_basic:     file format elf32-littlearm

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .debug_aranges 000010a0  00000000  00000000  00013da0  2**0
                  CONTENTS, READONLY, DEBUGGING
  1 .debug_pubnames 00002ed7  00000000  00000000  00014e40  2**0
                  CONTENTS, READONLY, DEBUGGING
  2 .debug_info   0006dda7  00000000  00000000  00017d17  2**0
                  CONTENTS, READONLY, DEBUGGING
  3 .debug_abbrev 00005adf  00000000  00000000  00085abe  2**0
                  CONTENTS, READONLY, DEBUGGING
  4 .debug_line   00012f73  00000000  00000000  0008b59d  2**0
                  CONTENTS, READONLY, DEBUGGING
  5 .rom_vectors  00000060  00008000  00008000  00008000  2**5
                  CONTENTS, ALLOC, LOAD, CODE
  6 .text         0000a850  00008060  00008060  00008060  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  7 .fini         00000000  000128b0  000128b0  0009e510  2**0
                  CONTENTS
  8 .rodata       000010e0  000128b0  000128b0  000128b0  2**2
                  CONTENTS, ALLOC, LOAD, DATA
  9 .rodata1      00000000  00013990  00013990  0009e510  2**0
                  CONTENTS
 10 .fixup        00000000  00013990  00013990  0009e510  2**0
                  CONTENTS
 11 .gcc_except_table 00000000  00013990  00013990  0009e510  2**0
                  CONTENTS
 12 .data         00000410  00013990  00013990  00013990  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 13 .bss          00587930  00013da0  00013da0  00013da0  2**4
                  ALLOC
 14 .sram         00000000  60000000  60000000  0009e510  2**0
                  CONTENTS


From this example, you can see that the code size of this program is
only 43k, but the debug information is quite large (750k).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]