1RGBLINK(5)                  BSD File Formats Manual                 RGBLINK(5)
2

NAME

4     rgblink — linkerscript file format
5

DESCRIPTION

7     The linkerscript is an external file that allows the user to specify the
8     order of sections without the need for doing so before assembling each
9     object file.
10
11     The placement of sections specified in the linkerscript is done before
12     the sections whose placement is defined in the source code.
13
14     A linkerscript consists on a series of banks followed by a list of sec‐
15     tions and, optionally, commands.  They can be lowercase or uppercase, it
16     is ignored.  Any line can contain a comment starting with ‘;’ that ends
17     at the end of the line:
18
19           ROMX $F ; This is a comment
20             "Functions to read array"
21             ALIGN 8
22             "Array aligned to 256 bytes"
23
24           WRAMX 2
25             "Some variables"
26
27     Numbers can be in decimal or hexadecimal format (the prefix is ‘$’).  It
28     is an error if any bank or command is found before setting a bank.
29
30     Files can be included by using the INCLUDE keyword followed by a string
31     with the path of the file that has to be included.
32
33     The possible bank types are: ROM0, ROMX, VRAM, WRAM0, WRAMX, OAM and
34     HRAM.  Types ROMX, VRAM, WRAMX and SRAM are banked, which means that it
35     is needed to specify a bank after the type.
36
37     When a new bank statement is found, sections found after it will be
38     placed right from the beginning of that bank.  If the linkerscript
39     switches to a different bank and then it comes back to the previous one
40     it will continue from the last address that was used.
41
42     The only two commands are ORG and ALIGN:
43
44     ·   ORG sets the address in which new sections will be placed.  It can
45         not be lower than the current address.
46
47     ·   ALIGN will increase the address until it is aligned to the specified
48         boundary (it tries to set to 0 the number of bits specified after the
49         command: ALIGN 8 will align to $100).
50
51     Note: The bank, alignment, address and type of sections can be specified
52     both in the source code and in the linkerscript.  For a section to be
53     able to be placed with the linkerscript the bank must be left unassigned
54     in the source code or be the same as the one specified in the linker‐
55     script. The address and alignment musn't be set.
56

SEE ALSO

58     rgbasm(1), rgblink(1), rgbfix(1), rgbds(5), rgbds(7)
59

HISTORY

61     rgblink was originally written by Carsten Sørensen as part of the ASMotor
62     package, and was later packaged in RGBDS by Justin Lloyd. It is now main‐
63     tained by a number of contributors at .:
64           https://github.com/rednex/rgbds
65
66RGBDS Manual                    April 17, 2017                    RGBDS Manual
Impressum