Core/link.x
Sweetbread 24c38957f4 Add *(.bss.*) to link.x; fixes #8
Const var, which is used for allocator, is .bss.alloc..., and because
there was no that pattern in link scrypt, FILE_END didn't count the var,
that's why initial zero value was overwritten by application name (see
MENUET01 header description for more info)
2024-05-26 02:19:11 +03:00

40 lines
891 B
Plaintext

PATH_SIZE = 1024;
PARAMS_SIZE = 256;
STACK_SIZE = 1024*64;
SECTIONS {
hdr : {
LONG(0x554e454D);
LONG(0x31305445);
LONG(1); // Header version
LONG(kol_main); // Program start
LONG(END); // Image size
LONG(FILE_END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); // Required amount of memory
LONG(FILE_END + PATH_SIZE + PARAMS_SIZE + STACK_SIZE); // Stack
LONG(FILE_END + PATH_SIZE); // Boot params
LONG(FILE_END); // Application path
}
.text : {
*(.text)
*(.text.*)
}
END = .;
.data ALIGN(16) : {
*(.rodata.*)
*(const)
*(CONST)
*(.data)
*(data)
}
.bss ALIGN(16) : {
*(.bss)
*(.bss.*)
}
FILE_END = .;
}