I'm trying to objcopy some elf file to ihex with following command:
arm-none-eabi-objcopy -j .flash_vectors -j .isr_vector \
-j .text -j .rodata ./app.elf -O ihex ./app.hex
and I'm trying to copy four sections to ihex. The problem is that objcopy copies only first three of them, without .rodata.
My question is why objcopy copies only the first three sections and not fourth (.rodata)?
Allocated sections from 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),