arch/riscv/kernel/vmlinux-xip.lds.S

Source file repositories/reference/linux-study-clean/arch/riscv/kernel/vmlinux-xip.lds.S

File Facts

System
Linux kernel
Corpus path
arch/riscv/kernel/vmlinux-xip.lds.S
Extension
.S
Size
2843 bytes
Lines
144
Domain
Architecture Layer
Bucket
arch/riscv
Inferred role
Architecture Layer: arch/riscv
Status
atlas-only

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

#include <asm/pgtable.h>
#define LOAD_OFFSET KERNEL_LINK_ADDR
/* No __ro_after_init data in the .rodata section - which will always be ro */
#define RO_AFTER_INIT_DATA

#include <asm/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/cache.h>
#include <asm/thread_info.h>
#include <asm/set_memory.h>

OUTPUT_ARCH(riscv)
ENTRY(_start)

jiffies = jiffies_64;

SECTIONS
{
	/* Beginning of code and text segment */
	. = LOAD_OFFSET;
	_xiprom = .;
	_start = .;
	HEAD_TEXT_SECTION
	INIT_TEXT_SECTION(PAGE_SIZE)
	/* we have to discard exit text and such at runtime, not link time */
	__exittext_begin = .;
	.exit.text :
	{
		EXIT_TEXT
	}
	__exittext_end = .;

	.text : {
		_text = .;
		_stext = .;
		TEXT_TEXT
		SCHED_TEXT
		LOCK_TEXT
		KPROBES_TEXT
		ENTRY_TEXT
		IRQENTRY_TEXT
		SOFTIRQENTRY_TEXT
		_etext = .;
	}
	RO_DATA(L1_CACHE_BYTES)
	.srodata : {
		*(.srodata*)
	}
	.init.rodata : {
		INIT_SETUP(16)
		INIT_CALLS
		CON_INITCALL
		INIT_RAM_FS
	}
	_exiprom = .;			/* End of XIP ROM area */


/*
 * From this point, stuff is considered writable and will be copied to RAM
 */
	__data_loc = ALIGN(PAGE_SIZE);		/* location in file */
	. = ALIGN(SECTION_ALIGN);		/* location in memory */

#undef LOAD_OFFSET
#define LOAD_OFFSET (KERNEL_LINK_ADDR + _sdata - __data_loc)

	_sdata = .;			/* Start of data section */
	_data = .;
	RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
	_edata = .;

Annotation

Implementation Notes