![]() ![]() Thus the BSS was born and claims all those globals left uninitialized by lazy programmers along with those specifically initialized to zero. ![]() _data_load_end = _data_load_start + SIZEOF(.data)ĭata : AT (ADDR (.text) + SIZEOF (.text)) The FT32 linker script file looks like this: The details of this memory map used during execution and while building the executable is specified in the linker script file. This file is input to the linker, and allows the linker to map the text/data/bss regions in every object file into real physical addresses and also influences the merging of all the sections together into the final executable file. Refer the LD documentation for more information on the syntax of the script. For our intents we can note that the sections named. data segment is itself stored after the end of the. To see the linker script being used in a build, use the -verbose option with LD.Ī map file can be generated by passing the -print-map > MyMapFile.txt string to LD. In addition the -cref option will print the cross-reference table which is very useful when you want to track down references to symbols. Scrolling down the map file you'll encounter a section named Linker script and memory map. ![]() This contains a breakdown of the memory contribution of each and every file that was linked into the final image. To illustrate the analysis I have created a simple project of two files. All the explanations will be based on this simple project. The text region of the example project looks like this: 'Finished building target: MapParser.elf' Compiling this project with the followingįt32-elf-gcc -I"C:/Program Files (x86)/FTDI/FT90x Toolchain/Toolchain/hardware/include" -O0 -g -fvar-tracking -fvar-tracking-assignments -Wall -c -fmessage-length=0 -ffunction-sections -MMD -MP -MF"main.d" -MT"main.d" -o "main.o" "./main.c"įt32-elf-gcc -I"C:/Program Files (x86)/FTDI/FT90x Toolchain/Toolchain/hardware/include" -O0 -g -fvar-tracking -fvar-tracking-assignments -Wall -c -fmessage-length=0 -ffunction-sections -MMD -MP -MF"test.d" -MT"test.d" -o "test.o" "./test.c"įt32-elf-gcc -L"C:/Program Files (x86)/FTDI/FT90x Toolchain/Toolchain/hardware/lib" -Wl,-gc-sections -Wl,-entry=_start -Wl,-print-map > Linker.map -Xlinker -cref -Xlinker -verbose -o "MapParser.elf". ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |