Professional Documents
Culture Documents
vLinkGen Memory Layout - WlzSnail's Blog-CSDN Blog PDF
vLinkGen Memory Layout - WlzSnail's Blog-CSDN Blog PDF
1. Code
3. Constant
6. Stack
Step1:
The most important thing for a link file is to assign the allocated section (Section) to a fixed location
(MemLayout). These sections can be packaged into a Group.
Therefore, the most important thing is the definition of the segment. The definition of the segment is
divided into:
1. Code segment
2. Constant segment
3. Stack segment
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 1/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
3、Option Byte
3. Other constants
3. Stack area
Step2:
1. After the relevant Section definition is completed, it must be constrained in the form of a group
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 2/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
2. The relevant Group can control which allocated Memeory Section it is specified to exist in
3. For the part that needs to be copied and run in RAM, it can be specified by the relevant Group
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 3/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
4. In the Group, related Sections can be recombined into larger Section Groups. At the same time,
you can set the alignment and initialization method of the relevant Section Group
Step3:
Some symbol variables can be defined in the link file, and these symbol variables can be used in the
code, and the relevant symbol variables need to be declared in the header file or source file.
For example: define the start and end of a segment as related symbol variables, and the related
symbol variables can be detected in the code to obtain the corresponding address information.
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 4/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
Define the Symbol in the link file, which has a corresponding address. You can use either the symbol
defined in the link file or the absolute address when defining the related Symbol in vLinkGen. As
above, _RESET uses symbols, and you can also fill in the absolute address in Value.
At the same time, if you want to use the corresponding symbol variable in the code, you need
to declare the corresponding symbol in the header file or source file.
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 5/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
It can be seen that the value of FunctionInRam_START_SEC is consistent with the value of
FunctionInRam$$Base.
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 6/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
Step4:
1. Initialized variables
2. Uninitialized variables
Step5:
This is the most important part, which is the specific division of the existing structure of the chip:
2、OPTION BYTE
3. Code area
4. Stack area
The above code area and stack area can also be divided into small areas to store data with different
functions
like
The stack area may also be divided to store programs running in RAM
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 7/8
5/12/23, 3:27 PM vLinkGen Memory Layout_WlzSnail's Blog-CSDN Blog
The code area should be divided into the startup code area and the regular code area
It is best to open up a part of the stack area used by the startup code in the stack area
https://blog.csdn.net/WlzSnail/article/details/121518168?ops_request_misc=%257B%2522request%255Fid%2522%253A%252216838853441680018… 8/8