objcopy从elf到hex文件的给定节

时间:2019-09-05 04:51:35

标签: arm stm32 elf objcopy cmsis

我正在尝试使用以下命令将一些elf文件objobj复制到ihex:

arm-none-eabi-objcopy  -j .flash_vectors -j .isr_vector \
    -j .text -j .rodata ./app.elf -O ihex ./app.hex

,我正在尝试将四个部分复制到ihex。问题在于objcopy仅复制其中的前三个,而没有.rodata。

我的问题是,为什么objcopy仅复制前三个部分而不复制第四部分(.rodata)?


readelf分配的部分

There are 25 section headers, starting at offset 0x97350:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .flash_vectors    PROGBITS        08010000 010000 000010 00   A  0   0  1
  [ 2] .isr_vector       PROGBITS        08010200 010200 0001ac 00   A  0   0 512
  [ 3] .text             PROGBITS        080103b0 0103b0 006cf0 00  AX  0   0 16
  [ 4] .rodata           PROGBITS        080170a0 0170a0 0007b4 00   A  0   0  4
  [ 5] .ARM              ARM_EXIDX       08017854 017854 000008 00  AL  3   0  4
  [ 6] .init_array       INIT_ARRAY      0801785c 01785c 000004 04  WA  0   0  4
  [ 7] .fini_array       FINI_ARRAY      08017860 017860 000004 04  WA  0   0  4
  [ 8] .data             PROGBITS        20000000 020000 000124 00  WA  0   0  4
  [ 9] .ccmram           PROGBITS        10000000 020124 000000 00   W  0   0  1
  [10] .bss              NOBITS          20000124 020124 004d3c 00  WA  0   0  4
  [11] ._user_heap_stack NOBITS          20004e60 020124 000600 00  WA  0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),

精灵信息

0 个答案:

没有答案