2019-12-02 16:48:36 +01:00
|
|
|
OUTPUT_ARCH(sh3)
|
|
|
|
OUTPUT_FORMAT(elf32-sh)
|
|
|
|
ENTRY(_start)
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
** bootram is the RAM physical location for global variable
|
|
|
|
** during the bootloader step.
|
|
|
|
** This location is realy important because no Casio's OS data
|
|
|
|
** should be overwrite (specially TLB information stored by Casio).
|
|
|
|
*/
|
2019-12-09 15:57:06 +01:00
|
|
|
ram (WX) : o = 0x88040000, l = 252k
|
|
|
|
rom (RX) : o = 0x00300200, l = 512k
|
|
|
|
ilram (WX) : o = 0xe5200000, l = 4k
|
2019-12-16 16:25:13 +01:00
|
|
|
xram (WX) : o = 0xe5007000, l = 8k
|
2019-12-09 15:57:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
PHDRS
|
|
|
|
{
|
|
|
|
text PT_LOAD ;
|
|
|
|
data PT_LOAD ;
|
|
|
|
bss PT_NULL ;
|
|
|
|
ubc PT_LOAD ;
|
|
|
|
vbr PT_LOAD ;
|
2019-12-02 16:48:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
** ROM sections
|
|
|
|
*/
|
|
|
|
. = ORIGIN(rom);
|
2020-01-10 17:21:44 +01:00
|
|
|
_brom = ABSOLUTE (0x00300000) ;
|
|
|
|
_srom = ABSOLUTE (0x200 +
|
|
|
|
SIZEOF(.text) +
|
|
|
|
SIZEOF(.data) +
|
|
|
|
SIZEOF(.vhex) +
|
|
|
|
SIZEOF(.ubc)) ;
|
|
|
|
|
2019-12-02 16:48:36 +01:00
|
|
|
.text : {
|
2019-12-16 16:25:13 +01:00
|
|
|
/* Source Code */
|
2019-12-02 16:48:36 +01:00
|
|
|
*(.pretext)
|
|
|
|
*(.text)
|
|
|
|
|
2019-12-16 16:25:13 +01:00
|
|
|
/* Read-Only data */
|
2019-12-02 16:48:36 +01:00
|
|
|
. = ALIGN(4);
|
|
|
|
*(.rodata)
|
|
|
|
*(.rodata.*)
|
2020-05-03 23:10:49 +02:00
|
|
|
|
|
|
|
/* Drivers */
|
|
|
|
_bdrivers_section = ALIGN(4);
|
|
|
|
*(SORT_BY_NAME(.driver.*));
|
|
|
|
_edrivers_section = . ;
|
2019-12-16 16:25:13 +01:00
|
|
|
|
|
|
|
/* Constructors, destructors */
|
|
|
|
_bctors = ALIGN(4) ;
|
|
|
|
*(SORT_BY_INIT_PRIORITY(.ctors.*))
|
|
|
|
*(.ctors);
|
2020-01-05 09:00:43 +01:00
|
|
|
_ectors = . ;
|
2019-12-16 16:25:13 +01:00
|
|
|
_bdtors = ALIGN(4) ;
|
|
|
|
*(SORT_BY_INIT_PRIORITY(.dtors.*))
|
|
|
|
*(.dtors);
|
2020-01-05 09:00:43 +01:00
|
|
|
_edtors = . ;
|
2019-12-20 11:31:34 +01:00
|
|
|
|
2020-01-05 09:00:43 +01:00
|
|
|
/* File System */
|
|
|
|
_bfilesystem_section = ALIGN(4) ;
|
|
|
|
*(.filesystem);
|
|
|
|
_efilesystem_section = . ;
|
2020-01-06 20:25:06 +01:00
|
|
|
|
|
|
|
/* Device */
|
|
|
|
_bdevice_section = ALIGN(4);
|
|
|
|
*(.device);
|
|
|
|
_edevice_section = . ;
|
2019-12-09 15:57:06 +01:00
|
|
|
} > rom : text
|
|
|
|
|
|
|
|
|
2019-12-02 16:48:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** RAM sctions
|
|
|
|
*/
|
2019-12-09 15:57:06 +01:00
|
|
|
. = ORIGIN(ram);
|
2019-12-02 16:48:36 +01:00
|
|
|
|
|
|
|
/* BootStrap Stack: should be wiped later ! */
|
|
|
|
/* (we force the section to be non loadable when the program is run) */
|
|
|
|
.bss (NOLOAD) : {
|
|
|
|
_bbss = . ;
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(4);
|
2019-12-09 15:57:06 +01:00
|
|
|
} > ram : bss
|
2019-12-02 16:48:36 +01:00
|
|
|
_sbss = SIZEOF(.bss);
|
|
|
|
|
|
|
|
/* Read-write data going to RAM */
|
2019-12-09 15:57:06 +01:00
|
|
|
.data ALIGN(4) : ALIGN(4) {
|
2019-12-02 16:48:36 +01:00
|
|
|
_bdata_rom = LOADADDR(.data) ;
|
|
|
|
_bdata_ram = . ;
|
2019-12-06 23:45:04 +01:00
|
|
|
|
2019-12-02 16:48:36 +01:00
|
|
|
*(.data)
|
|
|
|
|
2020-03-28 19:52:59 +01:00
|
|
|
_ram_start = ALIGN(4);
|
2019-12-09 15:57:06 +01:00
|
|
|
} > ram AT> rom : data
|
2019-12-02 16:48:36 +01:00
|
|
|
_sdata = SIZEOF(.data);
|
|
|
|
|
2019-12-16 16:25:13 +01:00
|
|
|
|
|
|
|
|
2019-12-02 16:48:36 +01:00
|
|
|
/*
|
|
|
|
** VBR space !
|
|
|
|
*/
|
2019-12-16 16:25:13 +01:00
|
|
|
. = ORIGIN(xram);
|
2019-12-02 16:48:36 +01:00
|
|
|
/* Interrupt / exception handlers */
|
2019-12-09 15:57:06 +01:00
|
|
|
.vhex ALIGN(4) : SUBALIGN(4) {
|
2019-12-02 16:48:36 +01:00
|
|
|
_bvhex_rom = LOADADDR(.vhex) ;
|
|
|
|
_bvhex_ram = . ;
|
|
|
|
_vhex_vbr = . - 0x100;
|
|
|
|
*(.vhex.exception) ;
|
|
|
|
. = _vhex_vbr + 0x400 ;
|
|
|
|
*(.vhex.tlb) ;
|
|
|
|
. = _vhex_vbr + 0x600 ;
|
|
|
|
*(.vhex.interrupt) ;
|
|
|
|
. = ALIGN(4);
|
2019-12-16 16:25:13 +01:00
|
|
|
} > xram AT> rom : vbr
|
2019-12-09 15:57:06 +01:00
|
|
|
_svhex = SIZEOF(.vhex);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
** DBR space !
|
|
|
|
*/
|
|
|
|
. = ORIGIN(ilram);
|
|
|
|
.ubc ALIGN(4) : ALIGN(4) {
|
|
|
|
_bubc_rom = LOADADDR(.ubc) ;
|
2020-05-28 18:33:46 +02:00
|
|
|
_vhex_dbr = . ;
|
2019-12-09 15:57:06 +01:00
|
|
|
_bubc_ram = . ;
|
|
|
|
|
|
|
|
*(.ubc.handler)
|
|
|
|
*(.ubc)
|
|
|
|
|
|
|
|
. = ALIGN(4);
|
|
|
|
} > ilram AT> rom : ubc
|
|
|
|
_subc = SIZEOF(.ubc);
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-02 16:48:36 +01:00
|
|
|
|
|
|
|
/* unwanted section */
|
|
|
|
/DISCARD/ : {
|
|
|
|
*(.debug_info)
|
|
|
|
*(.debug_abbrev)
|
|
|
|
*(.debug_loc)
|
|
|
|
*(.debug_aranges)
|
|
|
|
*(.debug_ranges)
|
|
|
|
*(.debug_line)
|
|
|
|
*(.debug_str)
|
|
|
|
*(.jcr)
|
|
|
|
*(.eh_frame_hdr)
|
|
|
|
*(.eh_frame)
|
|
|
|
*(.comment)
|
|
|
|
}
|
|
|
|
}
|