I understand compiling a source file to an object file. I think I event understand linking object files to an executable in ELF format. Where I am getting stumped is the relationship between the ELF formatted file and the "binaries" that are written to the flash memory of the ESP-12. For example, I compiled and linked some source files and have an executable (ELF) where if I dump the sections, I am presented with:
Sections:
Idx Name Size VMA LMA File off Algn
0 .data 00000540 3ffe8000 3ffe8000 000000e0 2**4
CONTENTS, ALLOC, LOAD, DATA
1 .rodata 0000039c 3ffe8540 3ffe8540 00000620 2**4
CONTENTS, ALLOC, LOAD, READONLY, DATA
2 .bss 000091f0 3ffe88e0 3ffe88e0 000009c0 2**4
ALLOC
3 .text 0000630a 40100000 40100000 000009bc 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
4 .irom0.text 00029848 40240000 40240000 00006cd0 2**4
CONTENTS, ALLOC, LOAD, READONLY, CODE
5 .xtensa.info 00000038 00000000 00000000 00030518 2**0
CONTENTS, READONLY
6 .xt.prop 00024504 00000000 00000000 00030550 2**0
CONTENTS, READONLY
7 .xt.lit 00001100 00000000 00000000 00054a54 2**0
CONTENTS, READONLY
8 .comment 00001a18 00000000 00000000 00055b54 2**0
CONTENTS, READONLY
9 .debug_frame 000001d0 00000000 00000000 0005756c 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_info 0000228c 00000000 00000000 0005773c 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_abbrev 0000095c 00000000 00000000 000599c8 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_loc 0000178c 00000000 00000000 0005a324 2**0
CONTENTS, READONLY, DEBUGGING
13 .debug_aranges 00000300 00000000 00000000 0005bab0 2**3
CONTENTS, READONLY, DEBUGGING
14 .debug_line 000028d9 00000000 00000000 0005bdb0 2**0
CONTENTS, READONLY, DEBUGGING
15 .debug_str 00000827 00000000 00000000 0005e689 2**0
CONTENTS, READONLY, DEBUGGING
16 .debug_ranges 00000118 00000000 00000000 0005eeb0 2**0
CONTENTS, READONLY, DEBUGGING
Now I have a plethora of tools called:
o gen_appbin
o esptool.py
o esptool-ck
I have various Makefiles that use these tools in different ways and result in "success" ... but what I want to do is understand the process so that I can write it up for others to subsequently understand it themselves.
I get the impression that the ELF file is now "decomposed" into two binary files and these are separately loaded into the Flash memory of the ESP-12 ... but that's where I end. Can some kind souls help me to understand what is going on here so that I may write it down and help others?
If there is reading I should do, am happy to do that ... and would welcome some pointers.
Neil