megadrive_test2

diff megadrive.ldscript @ 0:ce1b05082ac4

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Tue, 14 Mar 2017 05:59:33 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/megadrive.ldscript	Tue Mar 14 05:59:33 2017 +0200
     1.3 @@ -0,0 +1,47 @@
     1.4 +OUTPUT_ARCH(m68k)
     1.5 +
     1.6 +MEMORY
     1.7 +{
     1.8 +	rom : ORIGIN = 0x00000000, LENGTH = 0x00a00000
     1.9 +	ram : ORIGIN = 0x00ff0000, LENGTH = 0x00010000
    1.10 +}
    1.11 +
    1.12 +PROVIDE (_stacktop = 0x01000000);
    1.13 +
    1.14 +SECTIONS {
    1.15 +	/* ---- start of ROM ---- */
    1.16 +	/* .vect section is used to place the m68k exception vectors at the
    1.17 +	 * beginning of the address space
    1.18 +	 */
    1.19 +	.vect : { * (.vect); } >rom
    1.20 +	/* .romhdr section is used to place the SEGA ROM header at 0x100 */
    1.21 +	. = 0x100;
    1.22 +	.romhdr : { * (.romhdr); } >rom
    1.23 +	.text : { * (.text); } >rom
    1.24 +	.rodata : { * (.rodata); } >rom
    1.25 +
    1.26 +	/* place the load address of the .data section after .rodata */
    1.27 +	. = ALIGN(4);
    1.28 +	_data_lma = .;
    1.29 +	_rom_end = _data_lma + _data_size;
    1.30 +
    1.31 +	/* ---- start of RAM ---- */
    1.32 +	. = 0xff0000;
    1.33 +	/* place the .data section at the start of RAM */
    1.34 +	.data ALIGN(4): AT (_data_lma) {
    1.35 +		_data_start = .;
    1.36 +		* (.data);
    1.37 +		. = ALIGN(4);
    1.38 +		_data_end = .;
    1.39 +	} >ram
    1.40 +	_data_size = SIZEOF(.data);
    1.41 +
    1.42 +	/* place the .bss section at the end */
    1.43 +	.bss ALIGN(4): {
    1.44 +		_bss_start = .;
    1.45 +		* (.bss);
    1.46 +		. = ALIGN(4);
    1.47 +		_bss_end = .;
    1.48 +	} >ram
    1.49 +	_bss_size = SIZEOF(.bss);
    1.50 +}