Код: Выделить всё
$ arm-none-eabi-objdump -h test.elf
test.elf: file format elf32-littlearm
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00014480 00000000 00000000 00008000 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .relocate 00000090 20000000 00014480 00020000 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 000016ec 20000090 00014510 00020090 2**4
ALLOC
3 .stack 00002004 2000177c 00014510 0002177c 2**0
ALLOC
4 TOUCH_SAFETY_DATA_LOCATION 00000704 20004000 00014510 00024000 2**3
CONTENTS, ALLOC, LOAD, DATA
5 FMEA_SAFETY_DATA_LOCATION 00000070 20007c00 00014c14 00027c00 2**2
CONTENTS, ALLOC, LOAD, DATA
... (some 10 or so more sections)
Код: Выделить всё
from elftools.elf.elffile import ELFFile
for section in ELFFile(open("test.elf", "rb")).iter_sections():
print("{0:30s} 0b{1:08b}".format(section.name, section.header.sh_flags))
Код: Выделить всё
0b00000000
.text 0b00000110
.relocate 0b00000011
.bss 0b00000011
.stack 0b00000011
TOUCH_SAFETY_DATA_LOCATION 0b00000011
FMEA_SAFETY_DATA_LOCATION 0b00000011
... (some 10 or so more sections)
Подробнее здесь: https://stackoverflow.com/questions/405 ... learm-bina