1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-22 12:30:41 +00:00

Harmonized asm linker configs.

- All segments but CODE are optional and CODE is R/W. Both together allow to "just" write code/data without ever explicitly using a segment.

- Symbols are defined for the BSS. This allows to use/implement zerobss.

- The ZP memory area isn't artificially limited.
This commit is contained in:
Oliver Schmidt 2016-03-17 21:51:20 +01:00
parent d5092d2d3f
commit 78dcb61cb8
5 changed files with 21 additions and 21 deletions

View File

@ -12,7 +12,7 @@ MEMORY {
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes; ZEROPAGE: load = ZP, type = zp, optional = yes;
EXEHDR: load = HEADER, type = ro, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes;
CODE: load = MAIN, type = rw, optional = yes; CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = ro, optional = yes; RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw, optional = yes; DATA: load = MAIN, type = rw, optional = yes;
BSS: load = BSS, type = bss, optional = yes, define = yes; BSS: load = BSS, type = bss, optional = yes, define = yes;

View File

@ -12,7 +12,7 @@ MEMORY {
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes; ZEROPAGE: load = ZP, type = zp, optional = yes;
EXEHDR: load = HEADER, type = ro, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes;
CODE: load = MAIN, type = rw, optional = yes; CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = ro, optional = yes; RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw, optional = yes; DATA: load = MAIN, type = rw, optional = yes;
BSS: load = BSS, type = bss, optional = yes, define = yes; BSS: load = BSS, type = bss, optional = yes, define = yes;

View File

@ -3,7 +3,7 @@ FEATURES {
} }
SYMBOLS { SYMBOLS {
__EXEHDR__: type = import; __EXEHDR__: type = import;
__AUTOSTART__: type = import; # force inclusion of autostart "trailer" __AUTOSTART__: type = import; # force inclusion of autostart "trailer"
__STARTADDRESS__: type = export, value = %S; __STARTADDRESS__: type = export, value = %S;
} }
MEMORY { MEMORY {
@ -18,13 +18,13 @@ MEMORY {
TRAILER: file = %O, start = $0000, size = $0006; TRAILER: file = %O, start = $0000, size = $0006;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes; ZEROPAGE: load = ZP, type = zp, optional = yes;
EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs
EXEHDR: load = HEADER, type = ro, optional = yes; EXEHDR: load = HEADER, type = ro, optional = yes;
MAINHDR: load = MAINHDR, type = ro, optional = yes; MAINHDR: load = MAINHDR, type = ro, optional = yes;
CODE: load = MAIN, type = ro, define = yes, optional = yes; CODE: load = MAIN, type = rw, define = yes;
RODATA: load = MAIN, type = ro optional = yes; RODATA: load = MAIN, type = ro optional = yes;
DATA: load = MAIN, type = rw optional = yes; DATA: load = MAIN, type = rw optional = yes;
BSS: load = MAIN, type = bss, define = yes, optional = yes; BSS: load = MAIN, type = bss, optional = yes, define = yes;
AUTOSTRT: load = TRAILER, type = ro, optional = yes; AUTOSTRT: load = TRAILER, type = ro, optional = yes;
} }

View File

@ -5,7 +5,7 @@ SYMBOLS {
__LOADADDR__: type = import; __LOADADDR__: type = import;
} }
MEMORY { MEMORY {
ZP: file = "", start = $0002, size = $001A, define = yes; ZP: file = "", start = $0002, size = $00FE, define = yes;
LOADADDR: file = %O, start = %S - 2, size = $0002; LOADADDR: file = %O, start = %S - 2, size = $0002;
MAIN: file = %O, start = %S, size = $D000 - %S; MAIN: file = %O, start = %S, size = $D000 - %S;
} }
@ -13,8 +13,8 @@ SEGMENTS {
ZEROPAGE: load = ZP, type = zp, optional = yes; ZEROPAGE: load = ZP, type = zp, optional = yes;
LOADADDR: load = LOADADDR, type = ro; LOADADDR: load = LOADADDR, type = ro;
EXEHDR: load = MAIN, type = ro, optional = yes; EXEHDR: load = MAIN, type = ro, optional = yes;
CODE: load = MAIN, type = rw, optional = yes; CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = ro, optional = yes; RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw, optional = yes; DATA: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, optional = yes; BSS: load = MAIN, type = bss, optional = yes, define = yes;
} }

View File

@ -10,15 +10,15 @@ SYMBOLS {
} }
MEMORY { MEMORY {
# for size of ZP, see runtime/zeropage.s and c1p/extzp.s # for size of ZP, see runtime/zeropage.s and c1p/extzp.s
ZP: file = "", define = yes, start = $0002, size = $001A + $0006; ZP: file = "", define = yes, start = $0002, size = $00FE;
HEAD: file = %O, start = $0000, size = $00B6; HEAD: file = %O, start = $0000, size = $00B6;
MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S; MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
} }
SEGMENTS { SEGMENTS {
ZEROPAGE: load = ZP, type = zp; ZEROPAGE: load = ZP, type = zp, optional = yes;
BOOT: load = HEAD, type = ro, optional = yes; BOOT: load = HEAD, type = ro, optional = yes;
CODE: load = MAIN, type = rw; CODE: load = MAIN, type = rw;
RODATA: load = MAIN, type = rw; RODATA: load = MAIN, type = ro, optional = yes;
DATA: load = MAIN, type = rw; DATA: load = MAIN, type = rw, optional = yes;
BSS: load = MAIN, type = bss, define = yes; BSS: load = MAIN, type = bss, optional = yes, define = yes;
} }