rockbox/flash/bootloader/no_rom.lds
Boris Gjenero ca9111ef64 Add KEEP() around vectors in linker scripts.
Vectors are needed by the CPU, but they don't need to be accessed by Rockbox.
Without the KEEP(), they can be removed when liking with --gc-sections, 
creating a broken binary without any warnings. This tells the linker to not
remove them. It should enable use of --gc-sections for all targets. When not
using --gc-sections, this does not change the binary.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31351 a1c6a512-1295-4272-9138-f99709370657
2011-12-18 06:43:08 +00:00

62 lines
929 B
Text

/* This is for the variant without boot ROM,
where the flash ROM is mirrored to address zero */
OUTPUT_FORMAT(elf32-sh)
MEMORY
{
IRAM : ORIGIN = 0x0FFFF000, LENGTH = 0x1000
FLASH : ORIGIN = 0x00000000, LENGTH = 0x40000
}
SECTIONS
{
.vectors :
{
KEEP(*(.vectors))
. = ALIGN(0x200);
} > FLASH
.startup :
{
*(.startup)
. = ALIGN(0x4);
_begin_iramcopy = .;
} > FLASH
.text : AT ( _begin_iramcopy )
{
_begin_text = .;
*(.text)
*(.icode)
. = ALIGN(0x4);
_end_text = .;
} > IRAM
.data : AT ( _end_text )
{
_begin_data = .;
*(.data)
. = ALIGN(0x4);
_end_data = .;
} > IRAM
.bss : AT ( _end_data )
{
_begin_bss = .;
*(.bss)
. = ALIGN(0x4);
_end_bss = .;
} > IRAM
.stack :
{
_begin_stack = .;
*(.stack)
. = ALIGN(0x1000);
_end_stack = .;
} > IRAM
/* size of the program (without vectors) */
_total_size = SIZEOF(.startup) + SIZEOF(.text) + SIZEOF(.data);
}