Building A Program; Editing A Linker Script - Epson S5U1C17001C Manual

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.2)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

3.5 Building a Program

Building a program means compiling/assembling the necessary sources and linking the compiled/assembled sources, including
libraries, to generate an executable object file. This section describes how to execute a build process.
3.5.1

Editing a Linker Script

A linker script file is used to pass location information on object files comprising the executable file (.elf) to the linker.
This is normally not specified, and the default linker script is used. The default linker script is designed to write a source file in C
language and link it to a startup processing library (crt0.o). Thus, the linker script must be created and specified in the following
cases that differ from this scenario:
When altering the basic layout
When the RAM area is jointly used for multiple variables
When executing a program on RAM
When the program entry point (reset exception handler) has been changed from _start
When the vector table is defined other than crt0.o
When specifying 3.3 for the GCC Version.
Normally, the linker script must be created and specified if all source files of a project are written in assembly language.
 Creating a new linker script
The following folder contains the default linker script:
\GNU17V3\sample\sample_gcc6\elf32c17.x
Copy this file and save it in the project folder before modifying.
You can also use a text editor to create a new linker script.
 Editing a linker script
Linker script contents can be edited using a text editor. For detailed information on linker script contents, refer to Section 7.4.2,
"Examples of Linkage" in Chapter 7, "Linker."
 Specifying a linker script
Select C/C++ Build > Settings > [Tool Settings] > [Cross GCC Linker] > Miscellaneous from the [Properties] dialog box and
specify the linker script.
Specify a linker script using the -T option. If no linker script is specified, linking will use the default linker script.
Example: To specify the linker script file elf32c17.x in the project folder
-T ../elf32c17.x
S5U1C17001C Manual
(Rev. 1.0)
Seiko Epson Corporation
3 GNU17 IDE
3-14

Advertisement

Table of Contents
loading

Table of Contents