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:
parent
d5092d2d3f
commit
78dcb61cb8
@ -12,7 +12,7 @@ MEMORY {
|
||||
SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp, 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;
|
||||
DATA: load = MAIN, type = rw, optional = yes;
|
||||
BSS: load = BSS, type = bss, optional = yes, define = yes;
|
||||
|
@ -12,7 +12,7 @@ MEMORY {
|
||||
SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp, 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;
|
||||
DATA: load = MAIN, type = rw, optional = yes;
|
||||
BSS: load = BSS, type = bss, optional = yes, define = yes;
|
||||
|
@ -3,7 +3,7 @@ FEATURES {
|
||||
}
|
||||
SYMBOLS {
|
||||
__EXEHDR__: type = import;
|
||||
__AUTOSTART__: type = import; # force inclusion of autostart "trailer"
|
||||
__AUTOSTART__: type = import; # force inclusion of autostart "trailer"
|
||||
__STARTADDRESS__: type = export, value = %S;
|
||||
}
|
||||
MEMORY {
|
||||
@ -18,13 +18,13 @@ MEMORY {
|
||||
TRAILER: file = %O, start = $0000, size = $0006;
|
||||
}
|
||||
SEGMENTS {
|
||||
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
|
||||
EXEHDR: load = HEADER, type = ro, optional = yes;
|
||||
MAINHDR: load = MAINHDR, type = ro, optional = yes;
|
||||
CODE: load = MAIN, type = ro, define = yes, optional = yes;
|
||||
RODATA: load = MAIN, type = ro optional = yes;
|
||||
DATA: load = MAIN, type = rw optional = yes;
|
||||
BSS: load = MAIN, type = bss, define = yes, optional = yes;
|
||||
AUTOSTRT: load = TRAILER, type = ro, 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
|
||||
EXEHDR: load = HEADER, type = ro, optional = yes;
|
||||
MAINHDR: load = MAINHDR, type = ro, optional = yes;
|
||||
CODE: load = MAIN, type = rw, define = yes;
|
||||
RODATA: load = MAIN, type = ro optional = yes;
|
||||
DATA: load = MAIN, type = rw optional = yes;
|
||||
BSS: load = MAIN, type = bss, optional = yes, define = yes;
|
||||
AUTOSTRT: load = TRAILER, type = ro, optional = yes;
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ SYMBOLS {
|
||||
__LOADADDR__: type = import;
|
||||
}
|
||||
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;
|
||||
MAIN: file = %O, start = %S, size = $D000 - %S;
|
||||
}
|
||||
@ -13,8 +13,8 @@ SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
LOADADDR: load = LOADADDR, type = ro;
|
||||
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;
|
||||
DATA: load = MAIN, type = rw, optional = yes;
|
||||
BSS: load = MAIN, type = bss, optional = yes;
|
||||
BSS: load = MAIN, type = bss, optional = yes, define = yes;
|
||||
}
|
||||
|
@ -10,15 +10,15 @@ SYMBOLS {
|
||||
}
|
||||
MEMORY {
|
||||
# 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;
|
||||
MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
|
||||
MAIN: file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
|
||||
}
|
||||
SEGMENTS {
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
BOOT: load = HEAD, type = ro, optional = yes;
|
||||
CODE: load = MAIN, type = rw;
|
||||
RODATA: load = MAIN, type = rw;
|
||||
DATA: load = MAIN, type = rw;
|
||||
BSS: load = MAIN, type = bss, define = yes;
|
||||
RODATA: load = MAIN, type = ro, optional = yes;
|
||||
DATA: load = MAIN, type = rw, optional = yes;
|
||||
BSS: load = MAIN, type = bss, optional = yes, define = yes;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user