You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
2.4 KiB
Plaintext
73 lines
2.4 KiB
Plaintext
5 years ago
|
/* SPDX-License-Identifier: MIT OR Apache-2.0
|
||
5 years ago
|
*
|
||
3 years ago
|
* Copyright (c) 2018-2022 Andre Richter <andre.o.richter@gmail.com>
|
||
5 years ago
|
*/
|
||
|
|
||
3 years ago
|
__rpi_phys_dram_start_addr = 0;
|
||
4 years ago
|
|
||
3 years ago
|
/* The physical address at which the the kernel binary will be loaded by the Raspberry's firmware */
|
||
|
__rpi_phys_binary_load_addr = 0x80000;
|
||
4 years ago
|
|
||
3 years ago
|
|
||
|
ENTRY(__rpi_phys_binary_load_addr)
|
||
|
|
||
|
/* Flags:
|
||
|
* 4 == R
|
||
|
* 5 == RX
|
||
|
* 6 == RW
|
||
|
*
|
||
|
* Segments are marked PT_LOAD below so that the ELF file provides virtual and physical addresses.
|
||
|
* It doesn't mean all of them need actually be loaded.
|
||
|
*/
|
||
4 years ago
|
PHDRS
|
||
|
{
|
||
3 years ago
|
segment_boot_core_stack PT_LOAD FLAGS(6);
|
||
|
segment_code PT_LOAD FLAGS(5);
|
||
|
segment_data PT_LOAD FLAGS(6);
|
||
4 years ago
|
}
|
||
|
|
||
5 years ago
|
SECTIONS
|
||
|
{
|
||
3 years ago
|
. = __rpi_phys_dram_start_addr;
|
||
|
|
||
|
/***********************************************************************************************
|
||
|
* Boot Core Stack
|
||
|
***********************************************************************************************/
|
||
|
.boot_core_stack (NOLOAD) :
|
||
|
{
|
||
|
/* ^ */
|
||
|
/* | stack */
|
||
|
. += __rpi_phys_binary_load_addr; /* | growth */
|
||
|
/* | direction */
|
||
|
__boot_core_stack_end_exclusive = .; /* | */
|
||
|
} :segment_boot_core_stack
|
||
5 years ago
|
|
||
4 years ago
|
/***********************************************************************************************
|
||
|
* Code + RO Data + Global Offset Table
|
||
|
***********************************************************************************************/
|
||
5 years ago
|
.text :
|
||
|
{
|
||
4 years ago
|
KEEP(*(.text._start))
|
||
4 years ago
|
*(.text._start_arguments) /* Constants (or statics in Rust speak) read by _start(). */
|
||
|
*(.text._start_rust) /* The Rust entry point */
|
||
|
*(.text*) /* Everything else */
|
||
3 years ago
|
} :segment_code
|
||
5 years ago
|
|
||
3 years ago
|
.rodata : ALIGN(8) { *(.rodata*) } :segment_code
|
||
|
.got : ALIGN(8) { *(.got) } :segment_code
|
||
5 years ago
|
|
||
4 years ago
|
/***********************************************************************************************
|
||
|
* Data + BSS
|
||
|
***********************************************************************************************/
|
||
3 years ago
|
.data : { *(.data*) } :segment_data
|
||
5 years ago
|
|
||
3 years ago
|
/* Section is zeroed in pairs of u64. Align start and end to 16 bytes */
|
||
3 years ago
|
.bss (NOLOAD) : ALIGN(16)
|
||
5 years ago
|
{
|
||
|
__bss_start = .;
|
||
5 years ago
|
*(.bss*);
|
||
3 years ago
|
. = ALIGN(16);
|
||
|
__bss_end_exclusive = .;
|
||
3 years ago
|
} :segment_data
|
||
5 years ago
|
}
|