Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Section Running a Program on the Target Compiling and Linking with On Time RTOS-32 |
SectionLocate Section and Locate NTSection will map data from the application .EXE or a .DLL file. The data in PE files (Win32's portable executable file format) is divided into named sections. The Name parameter in a Locate Section or NTSection command maps to a name in the PE file. The special name PEHeader may be used to denote the PE file header. Example:Locate Section .text LowMem This command will map section .text from the EXE file to region LowMem. RTLoc will determine the type of access required and the size of section .text. What sections are required by a program depends on the compiler/linker used. RTLoc will write a complete list of all the PE file's sections to the .LOC file in the EXE File Report. Section Compiling and Linking with On Time RTOS-32 contains an overview of the sections generated by each compiler/linker. The complete syntax for the Name parameter in Locate Section and Locate NTSection commands is: [ModuleName.]SectionName or [ModuleName.]#SectionNumber The name of the section to be mapped may be prefixed with the name of the module containing the respective section. If omitted, the application's main .EXE file is assumed. Example:Locate Section Mydll.dll..idata LowMem This command will map section .idata of module Mydll.dll. Mydll.dll must have been referenced in a previous DLL command. By default, RTLoc will ignore and Locate Section or Locate NTSection commands for section names which do not exist. To change this behavior use RTLoc option -n. Some linkers may produce several sections with the same name or the name may contain unprintable characters. In this case, the section's number can be specified instead of its name. The PE file header has section number 0. Section numbering for all other sections starts at 1 (see the EXE File Report in the .LOC file for a complete list of all sections). Example:Locate Section .text LowMem Locate Section Somedll.dll.DATA HighMem Locate Section Mylib.dll.#3 MyROM The module's and the section's names are not case sensitive. The Size parameter has a special meaning for Sections and NTSections: it is used as the segment index into the map file. If specified, RTLoc will try to determine the size of the section by interpreting the module's MAP file. Example:Locate Section CODE LowMem 1 The map file produced by the linker might contain the following information: Start Length Name Class 0001:00000000 000005969H _TEXT CODE 0002:00000000 000001300H _DATA DATA 0002:00001300 000000000H _TLSCBA TLSCBA 0002:00001300 000000024H _INIT_ INITDATA 0002:00001324 000000000H _INITEND_ INITDATA 0002:00001324 000000006H _EXIT_ EXITDATA 0002:0000132A 000000000H _EXITEND_ EXITDATA 0002:0000132C 000000000H CONST CONST 0002:0000132C 000000624H _BSS BSS 0002:00001950 000000000H _BSSEND BSS RTLoc will find that segment 1 has a size of 5969h and will use this value instead of that from the PE file. This has the advantage of reducing the program's memory requirements, since some Win32 linkers will round up a section's size to a multiple of 512. If the specified region (or physical region in a virtual region specification) has memory type Device, the RTTarget-32 program loader will not zero-initialize the section. This feature is useful to support non-volatile RAM. For more information, please section Using Non-Volatile Memory in chapter Advanced Topics.
|