5-140
EPSOn
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
5 gnU17 iDE
Example linker script settings
Shown below are example linker script settings for several section configurations using sample screens. For
more information on making these settings, refer to the discussion on the preceding pages.
Example 1: Minimum section configuration
Example 2: Changing the basic layout
Example 3: Sharing the RAM area with multiple variables
Example 4: Executing a program in RAM
It is assumed that the vector table in the assembler source (
boot.o
) is written in the
.rodata
section and
that the table is set in the new project wizard to be located in the
.vector
section.
Example 1: Minimum section configuration
Described here is a system with the simplest possible configuration using RAM and ROM.
The program and data will be located in the ROM beginning with address 0x8000 as shown in Figure 5.7.6.2.
The program is assumed to run directly from its stored ROM address (LMA), and static data is also assumed
to be read out for use directly from the ROM. The variable without initial values will be located from address
0x0 in the RAM. Subsequent areas are used for variables with initial values. The initial values of variables are
stored in the ROM and copied from the ROM into the RAM by the application program.
Program
Vector table
Constants
and other static data
Variables
with initial values
Unused area
Stack area
0x008000
ROM
.data
section (LMA)
.rodata
section (LMA=VMA)
.text
section (LMA=VMA)
.vector
section (LMA=VMA)
Variables without initial
values and work area
Variables
with initial values
0x000fbf
0x000000
RAM
.data
section (VMA)
.bss
section (VMA)
Data
copied
Figure 5.7.6.2 Example of a memory configuration 1
Using default linker script files is the simplest method for using memory in this way.
This section location can be realized without adding to or correcting settings in the [GNU17 Linker Script Set-
tings] dialog box.
Example of a source file configuration
boot.s
(vector table and stack initialization, etc.)
main.c
(main and other functions)
The program is assumed to be comprised of these two sources.
Except when the location addresses of the respective sections are specified individually, the sections when
linked are located in alphabetical order of file names. In the example here, the sections are located in order of
boot.s
and
main.c
. The vector table at the beginning of
boot.s
(i.e., the
.rodata
section) is placed at
the beginning of the ROM (0x8000 and beyond).
Summary of Contents for S5U1C17001C
Page 6: ......
Page 17: ...1 General S5U1C17001C Manual 1 General ...
Page 18: ......
Page 21: ...1 2 Install S5U1C17001C Manual 2 Installation ...
Page 22: ......
Page 29: ...3 SoftDev S5U1C17001C Manual 3 Software Development Procedures ...
Page 30: ......
Page 103: ...4 SrcFiles S5U1C17001C Manual 4 Source files ...
Page 104: ......
Page 121: ...5 IDE S5U1C17001C Manual 5 gnU17 iDE ...
Page 122: ......
Page 365: ...6 Compiler S5U1C17001C Manual 6 C Compiler ...
Page 366: ......
Page 385: ...7 Library S5U1C17001C Manual 7 library ...
Page 386: ......
Page 405: ...8 Assemblr S5U1C17001C Manual 8 assembler ...
Page 406: ......
Page 439: ...9 Linker S5U1C17001C Manual 9 linker ...
Page 440: ......
Page 449: ...10 Debugger S5U1C17001C Manual 10 Debugger ...
Page 450: ......
Page 626: ...11 Tools S5U1C17001C Manual 11 Other Tools ...
Page 627: ......
Page 696: ...S1C17 Family C Compiler Package Quick Reference Reference ...