295
|
1 LWLINK linker scripts
|
|
2
|
|
3 A linker script is used to instruct the linker about how to assemble the
|
|
4 various sections into a completed binary. It consists of a series of
|
|
5 directives which are considered in the order they are encountered. Any
|
|
6 section not referenced by a directive is assumed to be loaded after the
|
|
7 final section explicitly referenced.
|
|
8
|
|
9 A section may only be referenced once. Any subsequent references will have
|
|
10 no effect.
|
|
11
|
|
12 section <name> load at <addr>
|
|
13
|
|
14 This causes the section <name> to load at <addr>. For raw target, only one
|
|
15 "load at" entry is allowed for non-bss sections and it must be the first
|
|
16 one. For raw targets, it affects the addresses the linker assigns to symbols
|
|
17 but has no other affect on the output. bss sections may all have separate
|
|
18 load addresses but since they will not appear in the binary anyway, this is
|
|
19 okay.
|
|
20
|
|
21 For the DECB target, each "load at" entry will cause a new "block" to be
|
|
22 output to the binary which will contain the load address. It is legal for
|
|
23 sections to overlap in this manner - the linker assumes the loader will sort
|
|
24 everything out.
|
|
25
|
|
26 section <name> load after <name2>
|
|
27
|
|
28 This will cause the section <name> to load after <name2>. This has the
|
|
29 effect of essentially gluing <name> onto the end of <name2>. If multiple
|
|
30 sections are specified to load after a particular section, they will load in
|
|
31 the order specified.
|
|
32
|
|
33 pad to <size>
|
|
34
|
|
35 This will cause the output file to be padded with NUL bytes to be exactly
|
|
36 <size> bytes in length. This only makes sense for a raw target.
|
|
37
|
|
38
|
|
39 If <name> is "*", then any section not already matched by the script will be
|
|
40 matched. For format *,<flags> can be used to select sections which have
|
|
41 particular flags set (or not set). For instance:
|
|
42
|
|
43 *,!bss This would match all sections that do not have the bss flag set
|
|
44 *,bss this would match all sections that do have the bss flag set
|
|
45
|
|
46
|