2008-08-06 08:19:54     ELF SIZE

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2008-08-06 08:19:54     ELF SIZE

Pranay Upadhyay (INDIA)

Message: 60035   

 

Hello sir,

 

   The size of the elf  file is 3410,446 bytes, which is generated by the bfin-elf-gcc.The problem I am facing that there is not too much flash memory size in my board.The flash memory size is 1 megabits. Can we reduce the size of elf file which suit in my application? Please guide me.

 

-Regards

 

Pranay

QuoteReplyEditDelete

 

 

2008-08-06 12:39:58     Re: ELF SIZE

Robin Getz (UNITED STATES)

Message: 60047   

 

Pranay:

 

did you try strip? To find out what is consuming the space - "bfin-elf-readelf -S file_name"

 

-Robin

QuoteReplyEditDelete

 

 

2008-08-07 01:26:19     Re: ELF SIZE

Pranay Upadhyay (INDIA)

Message: 60065   

 

Hello Robin sir,

 

   Thanks, I tried from this command I found that sdram0 is taking more space 32a040   ,because in the file bf561m.ld I write the memory allocation for the sdram, like

 

MEMORY

{

MEM_SDRAM0(wx) : ORIGIN = 0x0000c400, LENGTH = 0x7FF3C00  /*ADDED BY PRANAY*/

 

  MEM_L1_CODE : ORIGIN = 0xFFA00000, LENGTH = 0x4000

  MEM_L1_CODE_CACHE : ORIGIN = 0xFFA10000, LENGTH = 0x4000

  MEM_L1_SCRATCH : ORIGIN = 0xFFB00000, LENGTH = 0x1000

  MEM_L1_DATA_B : ORIGIN = 0xFF900000, LENGTH = 0x8000

  MEM_L1_DATA_A : ORIGIN = 0xFF800000, LENGTH = 0x8000

 

 

  B_MEM_L1_CODE : ORIGIN = 0xFF600000, LENGTH = 0x4000

  B_MEM_L1_CODE_CACHE : ORIGIN = 0xFF610000, LENGTH = 0x4000

  B_MEM_L1_SCRATCH : ORIGIN = 0xFF700000, LENGTH = 0x1000

  B_MEM_L1_DATA_B : ORIGIN = 0xFF500000, LENGTH = 0x8000

  B_MEM_L1_DATA_A : ORIGIN = 0xFF400000, LENGTH = 0x8000

  B_MEM_L1_STACK : ORIGIN = 0xFF501000, LENGTH = 0x8000  /* ADDED BY PRANAY*/

 

  MEM_L2 : ORIGIN = 0xFEB00000, LENGTH = 0x20000

  MEM_L2_SHARED : ORIGIN = 0xFEB20000, LENGTH = 0xC000  /* ADDED BY PRANAY*/

}

 

The memory map for the elf file for sdram is like this like this

 

[Nr] Name              Type            Addr                     Off                        Size       ES    Flg Lk Inf Al

  [ 0]                   NULL            00000000            000000            000000           00        0   0  0

  [ 1] .l2               PROGBITS        feb00000       32b000           00023c          00  AX  0   0  4

  [ 2] .l2_shared        PROGBITS  feb20000     32c000          000004          00  WA  0   0  4

  [ 3] .init             PROGBITS        ffa00000       330000          000012         00  AX  0   0  1

  [ 4] .b.text           PROGBITS        ff600000     32e000          000118           00  AX  0   0  2

  [ 5] .text             PROGBITS        ffa00014      330014            001ddc           00  AX  0   0  4

  [ 6] .fini             PROGBITS        ffa01df0       331df0            00000e           00  AX  0   0  1

  [ 7] .rodata           PROGBITS    f800000      32f000             000008           00   A  0   0  4

  [ 8] .eh_frame         PROGBITS ff800008    32f008            000004          00   A  0   0  4

  [ 9] .ctors            PROGBITS     ff80000c     32f00c             000008        00  WA  0   0  4

  [10] .dtors            PROGBITS   ff800014     32f014           000008          00  WA  0   0  4

  [11] .jcr              PROGBITS     ff80001c      32f01c            000004           00  WA  0   0  4

  [12] .b.data           PROGBITS  ff400000    32d000           000004           00  WA  0   0  4

  [13] .data             PROGBITS    ff800020    32f020             000824           00  WA  0   0  4

  [14] .SDRAM0           PROGBITS 0000c400     000400      32a040           00  WA  0   0  4

  [15] .b.bss            PROGBITS   ff400004        32d004            000004           00  WA  0   0  4

  [16] .bss              NOBITS          ff800844       32f844               00006c            00  WA  0   0  4

  [17] .comment          PROGBITS 00000000     331dfe             0002b2            00      0   0  1

  [18] .debug_aranges    PROGBITS 00000000     3320b0              0002b8         00      0   0  8

  [19] .debug_pubnames   PROGBITS  00000000         332368          000651          00      0   0  1

  [20] .debug_info       PROGBITS        00000000           3329b9           0078f0             00      0   0  1

  [21] .debug_abbrev     PROGBITS        00000000             33a2a9      001675             00      0   0  1

  [22] .debug_line       PROGBITS        00000000           33b91e         0017f5                 00      0   0  1

  [23] .debug_frame      PROGBITS        00000000            33d114          00062c            00      0   0  4

  [24] .debug_str        PROGBITS        00000000           33d740         000b8b                00      0   0  1

  [25] .debug_loc        PROGBITS        00000000           33e2cb         001b03               00      0   0  1

  [26] .debug_ranges     PROGBITS        00000000           33fdce          000088            00      0   0  1

  [27] .shstrtab         STRTAB          00000000             33fe56           0000f9                  00      0   0  1

  [28] .symtab           SYMTAB          00000000           340400          000aa0                  10     29  76  4

  [29] .strtab           STRTAB          00000000          340ea0          000bb2                00      0   0  1

 

 

           Can we treduce the size of elf file.

 

-Regards

 

Pranay

QuoteReplyEditDelete

 

 

2008-08-08 10:59:08     Re: ELF SIZE

Mike Frysinger (UNITED STATES)

Message: 60176   

 

the tools do what your code tells it to.  you cant just create large buffers and then expect the tools to magically shrink things.

 

if the data going into SDRAM0 takes up 0x32a040 bytes, and that is too much, then you need to go through your code and shrink things yourself.

Attachments

    Outcomes