S5U1C17001C ManUal
EPSOn
9-7
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
9 linkEr
9.6 Precautions
•
When the linker is executed, an error message as shown below may appear.
ld: test.elf: Not enough room for program header, try linking with -N
This error occurs in the alignment check for the data segment. The linker's alignment check can be disabled with
the
-N
option, so normally specify the
-N
option when invoking the linker. (The make file generated by the
IDE
contains the linker command line with the
-N
option.)
•
The object file names are case-sensitive. It is necessary to specify the exact same file name in the
ld
command
line and the linker script file. If the upper/lower case is different,
ld
considers them as two different files.
Example:
Command line
ld -T sample.lds -o sample.elf prg1.o prg2.o
Linker script file (
sample.lds
)
:
.text 0xc00000:
{
PRG1.o (.text)
←
PRG1.o
must be changed to
prg1.o
.
prg2.o (.text)
}
:
•
Linking files of different sizes with the same function name displays the following message.
Warning: size of symbol '
AAA
' changed from
BBB
to
CCC
in
DDD
.o
AAA
:
Duplicate function name
BBB
,
CCC
: Size of function
DDD
:
File name to be linked
If file sizes match, this message is not displayed. When linking files, be careful to avoid specifying the same
function name. Take particular care to avoid assigning a function name already included in the library file (
*.a
).
•
If "
*
" and individual object file specification coexist in a linker script file as in the example below, the files
may not link correctly. If object files do not need to be specified individually, use only "
*
". With this exception,
specify object files individually.
Example:
.text 0x00600000 :
{
*(.text) ;
}
.text2 :
{
main.o(.text) ;
}
•
Linking two or more library files (
*.a
) that contain the same function does not cause an error (no double linkage
performed).
Note that an error occurs when two or more object files (
*.o
) that contain the same function are linked.
•
If the located address, which is specified by a variable or the result of a calculation with a variable, is higher than
the 24-bit limit (0xffffff) or lower than 0x0, the address bits that exceed 24 bits are masked with 0 and no error
occurs.
Example:
xadd.a %r0,symbol-5
If the
symbol
is located at address 0, the specified absolute address is 0 - 5 = 0xfffffb (-5). Therefore, this
code will be assembled as "
xadd.a %r0,0xfffffb
".
9
Linker
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 ...