mirror of
https://github.com/andreili/katapult.git
synced 2025-08-24 03:44:06 +02:00
Modified linker script and loader to load whole bootloader to the RAM. Removed whatchdog. Fixed gpio.c compilation. Signed-off-by: Alex Malishev <malishev@gmail.com>
68 lines
1.6 KiB
ArmAsm
68 lines
1.6 KiB
ArmAsm
// rp2040 linker script (based on armcm_link.lds.S and customized for stage2)
|
|
//
|
|
// Copyright (C) 2019-2021 Kevin O'Connor <kevin@koconnor.net>
|
|
//
|
|
// This file may be distributed under the terms of the GNU GPLv3 license.
|
|
|
|
#include "autoconf.h" // CONFIG_FLASH_START
|
|
|
|
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
|
|
OUTPUT_ARCH(arm)
|
|
|
|
MEMORY
|
|
{
|
|
rom (rx) : ORIGIN = CONFIG_FLASH_START , LENGTH = CONFIG_FLASH_SIZE
|
|
ram (rwx) : ORIGIN = CONFIG_RAM_START , LENGTH = CONFIG_RAM_SIZE
|
|
}
|
|
|
|
SECTIONS
|
|
{
|
|
.text : {
|
|
. = ALIGN(4);
|
|
KEEP(*(.boot2))
|
|
KEEP(*(.vector_table_flash))
|
|
KEEP(*(.reset_handler_flash))
|
|
KEEP(*(.reset_handler_flash.*))
|
|
} > rom
|
|
|
|
. = ALIGN(4);
|
|
_data_flash = .;
|
|
|
|
.data : AT (_data_flash)
|
|
{
|
|
. = ALIGN(128);
|
|
_data_start = .;
|
|
KEEP(*(.vector_table))
|
|
*(.text .text.*)
|
|
*(.rodata .rodata*)
|
|
*(.ramfunc .ramfunc.*);
|
|
*(.data .data.*);
|
|
. = ALIGN(4);
|
|
_data_end = .;
|
|
} > ram
|
|
|
|
.bss (NOLOAD) :
|
|
{
|
|
. = ALIGN(4);
|
|
_bss_start = .;
|
|
*(.bss .bss.*)
|
|
*(COMMON)
|
|
. = ALIGN(4);
|
|
_bss_end = .;
|
|
} > ram
|
|
|
|
_stack_start = CONFIG_RAM_START + CONFIG_RAM_SIZE - CONFIG_STACK_SIZE - 1024;
|
|
.stack _stack_start (NOLOAD) :
|
|
{
|
|
. = . + CONFIG_STACK_SIZE;
|
|
_stack_end = .;
|
|
} > ram
|
|
|
|
/DISCARD/ : {
|
|
// The .init/.fini sections are used by __libc_init_array(), but
|
|
// that isn't needed so no need to include them in the binary.
|
|
*(.init)
|
|
*(.fini)
|
|
}
|
|
}
|