ВходНаше всё Теги codebook 无线电组件 Поиск Опросы Закон Вторник
26 ноября
1067945 Топик полностью
evgeniy1294 (09.01.2021 21:55 - 22:02, просмотров: 373) ответил my504 на Спасибо. То есть интегральной картинки в среде нет... Будем знать. )))
В составе пакета binutils есть волшебная программа size, которая по elf-файлу может выдать итоговые размеры прошивки. Именно её или её аналог в зависимости от выбранного компилера зовет keil в конце сборки: 
[100%] Linking CXX executable blink.elf
   text    data     bss     dec     hex filename
   1356     120    1736    3212     c8c blink.elf

И есть даже более классная readelf, именно которой вам и надо пользоваться (возможно, позвал для прошивки под другую плату). Как видим, там есть все: размеры секций, кто сколько места занимает и много другого полезного.

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x8000151
  Start of program headers:          52 (bytes into file)
  Start of section headers:          565272 (bytes into file)
  Flags:                             0x5000200, Version5 EABI, soft-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         24
  Section header string table index: 23

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .isr_flash        PROGBITS        08000000 010000 0000bc 00   A  0   0  4
  [ 2] .text             PROGBITS        080000bc 0100bc 000490 00  AX  0   0  4
  [ 3] .rodata           PROGBITS        0800054c 01054c 000004 00   A  0   0  4
  [ 4] .ARM.exidx        ARM_EXIDX       08000550 010550 000008 00  AL  2   0  4
  [ 5] .data             PROGBITS        20000000 020000 000070 00  WA  0   0  4
  [ 6] .init_array       INIT_ARRAY      08000558 010558 000004 04  WA  0   0  4
  [ 7] .fini_array       FINI_ARRAY      0800055c 01055c 000004 04  WA  0   0  4
  [ 8] .bss              NOBITS          20000070 020070 0000c8 00  WA  0   0  4
  [ 9] ._user_heap_stack NOBITS          20000138 020138 000600 00  WA  0   0  1
  [10] .ARM.attributes   ARM_ATTRIBUTES  00000000 020070 000028 00      0   0  1
  [11] .comment          PROGBITS        00000000 020098 00001e 01  MS  0   0  1
  [12] .debug_info       PROGBITS        00000000 0200b6 002a37 00      0   0  1
  [13] .debug_abbrev     PROGBITS        00000000 022aed 000c91 00      0   0  1
  [14] .debug_loc        PROGBITS        00000000 02377e 0000aa 00      0   0  1
  [15] .debug_aranges    PROGBITS        00000000 023828 000088 00      0   0  1
  [16] .debug_ranges     PROGBITS        00000000 0238b0 0000e8 00      0   0  1
  [17] .debug_macro      PROGBITS        00000000 023998 00ee36 00      0   0  1
  [18] .debug_line       PROGBITS        00000000 0327ce 001ee9 00      0   0  1
  [19] .debug_str        PROGBITS        00000000 0346b7 05436f 01  MS  0   0  1
  [20] .debug_frame      PROGBITS        00000000 088a28 0002f0 00      0   0  4
  [21] .symtab           SYMTAB          00000000 088d18 000b30 10     22 121  4
  [22] .strtab           STRTAB          00000000 089848 0006cf 00      0   0  1
  [23] .shstrtab         STRTAB          00000000 089f17 000100 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  y (purecode), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  EXIDX          0x010550 0x08000550 0x08000550 0x00008 0x00008 R   0x4
  LOAD           0x010000 0x08000000 0x08000000 0x00560 0x00560 RWE 0x10000
  LOAD           0x020000 0x20000000 0x08000560 0x00070 0x00138 RW  0x10000
  LOAD           0x000138 0x20000138 0x080005d0 0x00000 0x00600 RW  0x10000

 Section to Segment mapping:
  Segment Sections...
   00     .ARM.exidx
   01     .isr_flash .text .rodata .ARM.exidx .init_array .fini_array
   02     .data .bss
   03     ._user_heap_stack

There is no dynamic section in this file.

There are no relocations in this file.

Unwind section '.ARM.exidx' at offset 0x10550 contains 1 entry:

0x80000bc <_stack_init>: 0x1 [cantunwind]

Symbol table '.symtab' contains 179 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND
     1: 08000000     0 SECTION LOCAL  DEFAULT    1
     2: 080000bc     0 SECTION LOCAL  DEFAULT    2
     3: 0800054c     0 SECTION LOCAL  DEFAULT    3
     4: 08000550     0 SECTION LOCAL  DEFAULT    4
     5: 20000000     0 SECTION LOCAL  DEFAULT    5
     6: 08000558     0 SECTION LOCAL  DEFAULT    6
     7: 0800055c     0 SECTION LOCAL  DEFAULT    7
     8: 20000070     0 SECTION LOCAL  DEFAULT    8
     9: 20000138     0 SECTION LOCAL  DEFAULT    9
    10: 00000000     0 SECTION LOCAL  DEFAULT   10
    11: 00000000     0 SECTION LOCAL  DEFAULT   11
    12: 00000000     0 SECTION LOCAL  DEFAULT   12
    13: 00000000     0 SECTION LOCAL  DEFAULT   13
    14: 00000000     0 SECTION LOCAL  DEFAULT   14
    15: 00000000     0 SECTION LOCAL  DEFAULT   15
    16: 00000000     0 SECTION LOCAL  DEFAULT   16
    17: 00000000     0 SECTION LOCAL  DEFAULT   17
    18: 00000000     0 SECTION LOCAL  DEFAULT   18
    19: 00000000     0 SECTION LOCAL  DEFAULT   19
    20: 00000000     0 SECTION LOCAL  DEFAULT   20
    21: 00000000     0 FILE    LOCAL  DEFAULT  ABS startup_gcc.cpp
    22: 0800014c     0 NOTYPE  LOCAL  DEFAULT    2 $t
    23: 080001a0     0 NOTYPE  LOCAL  DEFAULT    2 $d
    24: 080002c0     0 NOTYPE  LOCAL  DEFAULT    2 $t
    25: 08000000     0 NOTYPE  LOCAL  DEFAULT    1 $d
    26: 08000000   188 OBJECT  LOCAL  DEFAULT    1 _ZL14InterruptTable
    27: 00000000     0 FILE    LOCAL  DEFAULT  ABS /usr/lib/gcc/arm[...]
    28: 08000534     0 NOTYPE  LOCAL  DEFAULT    2 $t
    29: 08000540     0 NOTYPE  LOCAL  DEFAULT    2 $t
    30: 00000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    31: 08000530     0 OBJECT  LOCAL  DEFAULT    2 __EH_FRAME_BEGIN__
    32: 20000000     0 NOTYPE  LOCAL  DEFAULT    5 $d
    33: 08000238     0 NOTYPE  LOCAL  DEFAULT    2 $t
    34: 08000239     0 FUNC    LOCAL  DEFAULT    2 __do_global_dtors_aux
    35: 08000254     0 NOTYPE  LOCAL  DEFAULT    2 $d
    36: 20000080     0 OBJECT  LOCAL  DEFAULT    8 completed.1
    37: 0800055c     0 NOTYPE  LOCAL  DEFAULT    7 $d
    38: 0800055c     0 OBJECT  LOCAL  DEFAULT    7 __do_global_dtor[...]
    39: 08000260     0 NOTYPE  LOCAL  DEFAULT    2 $t
    40: 08000261     0 FUNC    LOCAL  DEFAULT    2 frame_dummy
    41: 08000274     0 NOTYPE  LOCAL  DEFAULT    2 $d
    42: 20000084     0 OBJECT  LOCAL  DEFAULT    8 object.0
    43: 08000558     0 NOTYPE  LOCAL  DEFAULT    6 $d
    44: 08000558     0 OBJECT  LOCAL  DEFAULT    6 __frame_dummy_in[...]
    45: 20000080     0 NOTYPE  LOCAL  DEFAULT    8 $d
    46: 20000084     0 NOTYPE  LOCAL  DEFAULT    8 $d
    47: 00000000     0 FILE    LOCAL  DEFAULT  ABS /usr/lib/gcc/arm[...]
    48: 080000bc     0 NOTYPE  LOCAL  DEFAULT    2 $t
    49: 08000550     0 NOTYPE  LOCAL  DEFAULT    4 $d
    50: 08000114     0 NOTYPE  LOCAL  DEFAULT    2 $d
    51: 00000000     0 FILE    LOCAL  DEFAULT  ABS main.cpp
    52: 08000280     0 NOTYPE  LOCAL  DEFAULT    2 $t
    53: 080002bc     0 NOTYPE  LOCAL  DEFAULT    2 $d
    54: 20000070     0 NOTYPE  LOCAL  DEFAULT    8 $d
    55: 00000000     0 FILE    LOCAL  DEFAULT  ABS cortex_m.cpp
    56: 08000130     0 NOTYPE  LOCAL  DEFAULT    2 $t
    57: 08000138     0 NOTYPE  LOCAL  DEFAULT    2 $d
    58: 0800013c     0 NOTYPE  LOCAL  DEFAULT    2 $t
    59: 08000148     0 NOTYPE  LOCAL  DEFAULT    2 $d
    60: 2000007c     0 NOTYPE  LOCAL  DEFAULT    8 $d
    61: 00000000     0 FILE    LOCAL  DEFAULT  ABS bsp.cpp
    62: 080001b8     0 NOTYPE  LOCAL  DEFAULT    2 $t
    63: 08000220     0 NOTYPE  LOCAL  DEFAULT    2 $d
    64: 00000000     0 FILE    LOCAL  DEFAULT  ABS atexit.c
    65: 080002c8     0 NOTYPE  LOCAL  DEFAULT    2 $t
    66: 00000000     0 FILE    LOCAL  DEFAULT  ABS exit.c
    67: 080002d8     0 NOTYPE  LOCAL  DEFAULT    2 $t
    68: 080002fc     0 NOTYPE  LOCAL  DEFAULT    2 $d
    69: 00000000     0 FILE    LOCAL  DEFAULT  ABS fini.c
    70: 08000304     0 NOTYPE  LOCAL  DEFAULT    2 $t
    71: 08000324     0 NOTYPE  LOCAL  DEFAULT    2 $d
    72: 00000000     0 FILE    LOCAL  DEFAULT  ABS impure.c
    73: 20000004     0 NOTYPE  LOCAL  DEFAULT    5 $d
    74: 20000008    96 OBJECT  LOCAL  DEFAULT    5 impure_data
    75: 20000008     0 NOTYPE  LOCAL  DEFAULT    5 $d
    76: 0800054c     0 NOTYPE  LOCAL  DEFAULT    3 $d
    77: 00000000     0 FILE    LOCAL  DEFAULT  ABS init.c
    78: 0800032c     0 NOTYPE  LOCAL  DEFAULT    2 $t
    79: 08000364     0 NOTYPE  LOCAL  DEFAULT    2 $d
    80: 00000000     0 FILE    LOCAL  DEFAULT  ABS memcpy-stub.c
    81: 08000374     0 NOTYPE  LOCAL  DEFAULT    2 $t
    82: 00000000     0 FILE    LOCAL  DEFAULT  ABS memset.c
    83: 08000386     0 NOTYPE  LOCAL  DEFAULT    2 $t
    84: 00000000     0 FILE    LOCAL  DEFAULT  ABS __atexit.c
    85: 08000398     0 NOTYPE  LOCAL  DEFAULT    2 $t
    86: 08000450     0 NOTYPE  LOCAL  DEFAULT    2 $d
    87: 2000009c   140 OBJECT  LOCAL  DEFAULT    8 _global_atexit0
    88: 2000009c     0 NOTYPE  LOCAL  DEFAULT    8 $d
    89: 20000068     0 NOTYPE  LOCAL  DEFAULT    5 $d
    90: 00000000     0 FILE    LOCAL  DEFAULT  ABS __call_atexit.c
    91: 08000464     0 NOTYPE  LOCAL  DEFAULT    2 $t
    92: 0800050c     0 NOTYPE  LOCAL  DEFAULT    2 $d
    93: 20000128     0 NOTYPE  LOCAL  DEFAULT    8 $d
    94: 2000006c     0 NOTYPE  LOCAL  DEFAULT    5 $d
    95: 00000000     0 FILE    LOCAL  DEFAULT  ABS lock.c
    96: 08000514     0 NOTYPE  LOCAL  DEFAULT    2 $t
    97: 08000516     0 NOTYPE  LOCAL  DEFAULT    2 $t
    98: 08000518     0 NOTYPE  LOCAL  DEFAULT    2 $t
    99: 0800051a     0 NOTYPE  LOCAL  DEFAULT    2 $t
   100: 0800051c     0 NOTYPE  LOCAL  DEFAULT    2 $t
   101: 0800051e     0 NOTYPE  LOCAL  DEFAULT    2 $t
   102: 08000520     0 NOTYPE  LOCAL  DEFAULT    2 $t
   103: 08000524     0 NOTYPE  LOCAL  DEFAULT    2 $t
   104: 08000528     0 NOTYPE  LOCAL  DEFAULT    2 $t
   105: 0800052a     0 NOTYPE  LOCAL  DEFAULT    2 $t
   106: 00000000     0 FILE    LOCAL  DEFAULT  ABS _exit.c
   107: 0800052c     0 NOTYPE  LOCAL  DEFAULT    2 $t
   108: 00000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
   109: 08000530     0 NOTYPE  LOCAL  DEFAULT    2 $d
   110: 08000530     0 OBJECT  LOCAL  DEFAULT    2 __FRAME_END__
   111: 00000000     0 FILE    LOCAL  DEFAULT  ABS /usr/lib/gcc/arm[...]
   112: 08000538     0 NOTYPE  LOCAL  DEFAULT    2 $t
   113: 08000544     0 NOTYPE  LOCAL  DEFAULT    2 $t
   114: 00000000     0 FILE    LOCAL  DEFAULT  ABS
   115: 08000560     0 NOTYPE  LOCAL  DEFAULT    7 __fini_array_end
   116: 0800055c     0 NOTYPE  LOCAL  DEFAULT    7 __fini_array_start
   117: 0800055c     0 NOTYPE  LOCAL  DEFAULT    6 __init_array_end
   118: 08000558     0 NOTYPE  LOCAL  DEFAULT    6 __preinit_array_end
   119: 08000558     0 NOTYPE  LOCAL  DEFAULT    6 __init_array_start
   120: 08000558     0 NOTYPE  LOCAL  DEFAULT    6 __preinit_array_start
   121: 20000070    12 OBJECT  GLOBAL DEFAULT    8 tim
   122: 20000000     0 NOTYPE  GLOBAL DEFAULT    5 __data_start__
   123: 2000012c     1 OBJECT  GLOBAL DEFAULT    8 __lock___atexit_[...]
   124: 2000012d     1 OBJECT  GLOBAL DEFAULT    8 __lock___arc4ran[...]
   125: 2000006c     4 OBJECT  GLOBAL DEFAULT    5 __atexit_recursi[...]
   126: 08000519     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_close
   127: 0800054c     0 NOTYPE  GLOBAL DEFAULT    2 _etext
   128: 08000375    18 FUNC    GLOBAL DEFAULT    2 memcpy
   129: 20000070     0 NOTYPE  GLOBAL DEFAULT    8 __bss_start__
   130: 20000000     0 OBJECT  GLOBAL HIDDEN     5 __dso_handle
   131: 00000200     0 NOTYPE  GLOBAL DEFAULT  ABS __MinHeapSize
   132: 080001b9   128 FUNC    GLOBAL DEFAULT    2 _ZN3bsp4InitEv
   133: 08000151   104 FUNC    GLOBAL DEFAULT    2 ResetHandler
   134: 2000012e     1 OBJECT  GLOBAL DEFAULT    8 __lock___env_rec[...]
   135: 2000012f     1 OBJECT  GLOBAL DEFAULT    8 __lock___sinit_r[...]
   136: 0800054c     4 OBJECT  GLOBAL DEFAULT    3 _global_impure_ptr
   137: 2000007c     4 OBJECT  GLOBAL DEFAULT    8 _ZN3mpp4core9__p[...]
   138: 0800032d    72 FUNC    GLOBAL DEFAULT    2 __libc_init_array
   139: 080000c9     0 FUNC    GLOBAL DEFAULT    2 _mainCRTStartup
   140: 0800014d     4 FUNC    GLOBAL DEFAULT    2 DefaultHandler
   141: 08000535     0 FUNC    GLOBAL DEFAULT    2 _init
   142: 08000131    12 FUNC    GLOBAL DEFAULT    2 _ZN3mpp4core9__p[...]
   143: 08000305    40 FUNC    GLOBAL DEFAULT    2 __libc_fini_array
   144: 20000130     1 OBJECT  GLOBAL DEFAULT    8 __lock___malloc_[...]
   145: 0800013d    16 FUNC    GLOBAL DEFAULT    2 _ZN3mpp4core9__p[...]
   146: 08000560     0 NOTYPE  GLOBAL DEFAULT    1 __firmware_end__
   147: 0800052b     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   148: 20000070     0 NOTYPE  GLOBAL DEFAULT    5 __data_end__
   149: 08000525     4 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   150: 20000138     0 NOTYPE  GLOBAL DEFAULT    8 __bss_end__
   151: 20000128     4 OBJECT  GLOBAL DEFAULT    8 _global_atexit
   152: 08000465   176 FUNC    GLOBAL DEFAULT    2 __call_exitprocs
   153: 080000c9     0 FUNC    GLOBAL DEFAULT    2 _start
   154: 08000521     4 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   155: 08000399   204 FUNC    GLOBAL DEFAULT    2 __register_exitproc
   156: 080000bd     0 FUNC    WEAK   DEFAULT    2 _stack_init
   157: 20000068     4 OBJECT  GLOBAL DEFAULT    5 __atexit_dummy
   158: 08000560     0 NOTYPE  GLOBAL DEFAULT  ABS __data_load__
   159: 080002c1     8 FUNC    WEAK   DEFAULT    2 _ZN3mpp4core8cor[...]
   160: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS __MinStackSize
   161: 0800051b     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   162: 0800051f     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   163: 08000387    16 FUNC    GLOBAL DEFAULT    2 memset
   164: 08000281    64 FUNC    GLOBAL DEFAULT    2 main
   165: 08000517     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   166: 08000515     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_init
   167: 08000541     0 FUNC    GLOBAL DEFAULT    2 _fini
   168: 080002c9    16 FUNC    GLOBAL DEFAULT    2 atexit
   169: 20009000     0 NOTYPE  GLOBAL DEFAULT    1 __initial_sp__
   170: 20000004     4 OBJECT  GLOBAL DEFAULT    5 _impure_ptr
   171: 20000131     1 OBJECT  GLOBAL DEFAULT    8 __lock___at_quic[...]
   172: 080002d9    44 FUNC    GLOBAL DEFAULT    2 exit
   173: 0800051d     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   174: 08000529     2 FUNC    GLOBAL DEFAULT    2 __retarget_lock_[...]
   175: 0800052d     2 FUNC    GLOBAL DEFAULT    2 _exit
   176: 20000132     1 OBJECT  GLOBAL DEFAULT    8 __lock___dd_hash[...]
   177: 20000133     1 OBJECT  GLOBAL DEFAULT    8 __lock___tz_mutex
   178: 20000134     1 OBJECT  GLOBAL DEFAULT    8 __lock___sfp_rec[...]

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "6S-M"
  Tag_CPU_arch: v6S-M
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-1
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: small