Finding address of a C struct inside an ELF file compatible to ARM Architecture -
in project defined: (this not real code - abstraction purpose)
typedef struct { ... } my_struct;
in c file declared:
my_struct my_struct_inst;
and in other 2 c files used struct declaring:
extern my_struct my_struct_inst;
and used it's contents.
i compiled code arm rvct2.2 , trying find address of structure:
1) when memory being allocated my_struct_inst? on compilation time? on run time?
2) in disassembly can see in .flash_ram
section (probably kind of data belongs) there reference like: my_struct_inst % 0x190 got ida. mean? (that struct instance start @ offset 0x190 beginning of .flash_ram
section?)
3) how actual address (where struct sitting in memory) being accessed when write my_struct_inst.some_member
(should read abi documentation?)
the memory structure allocated @ compilation time.
the address defined linker script. see address of structure (assuming global variable), need generated elf file (lets call a.elf, example). run:
arm-eabi-objdump -t a.elf | grep my_struct_inst
objdump "-t" list global symbols address , section belongs too. can replace "objdump" cross-compiled objdump have.
Comments
Post a Comment