arch/arm64/kernel/vmlinux.lds.S

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

File Facts

System
Linux kernel
Corpus path
arch/arm64/kernel/vmlinux.lds.S
Extension
.S
Size
10561 bytes
Lines
438
Domain
Architecture Layer
Bucket
arch/arm64
Inferred role
Architecture Layer: arch/arm64
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/hyp_image.h>
#ifdef CONFIG_KVM
#define HYPERVISOR_EXTABLE					\
	. = ALIGN(SZ_8);					\
	__start___kvm_ex_table = .;				\
	*(__kvm_ex_table)					\
	__stop___kvm_ex_table = .;

#ifdef CONFIG_NVHE_EL2_TRACING
#define HYPERVISOR_EVENT_IDS 					\
	. = ALIGN(PAGE_SIZE);					\
	__hyp_event_ids_start = .;				\
	*(HYP_SECTION_NAME(.event_ids))				\
	__hyp_event_ids_end = .;
#else
#define HYPERVISOR_EVENT_IDS
#endif

#define HYPERVISOR_RODATA_SECTIONS				\
	HYP_SECTION_NAME(.rodata) : {				\
		. = ALIGN(PAGE_SIZE);				\
		__hyp_rodata_start = .;				\
		*(HYP_SECTION_NAME(.data..ro_after_init))	\
		*(HYP_SECTION_NAME(.rodata))			\
		HYPERVISOR_EVENT_IDS				\
		. = ALIGN(PAGE_SIZE);				\
		__hyp_rodata_end = .;				\
	}

#define HYPERVISOR_DATA_SECTION					\
	HYP_SECTION_NAME(.data) : {				\
		. = ALIGN(PAGE_SIZE);				\
		__hyp_data_start = .;				\
		*(HYP_SECTION_NAME(.data))			\
		. = ALIGN(PAGE_SIZE);				\
		__hyp_data_end = .;				\
	}

#define HYPERVISOR_PERCPU_SECTION				\
	. = ALIGN(PAGE_SIZE);					\
	HYP_SECTION_NAME(.data..percpu) : {			\
		*(HYP_SECTION_NAME(.data..percpu))		\
	}

#define HYPERVISOR_RELOC_SECTION				\
	.hyp.reloc : ALIGN(4) {					\
		__hyp_reloc_begin = .;				\
		*(.hyp.reloc)					\
		__hyp_reloc_end = .;				\
	}

#define BSS_FIRST_SECTIONS					\
	__hyp_bss_start = .;					\
	*(HYP_SECTION_NAME(.bss))				\
	. = ALIGN(PAGE_SIZE);					\
	__hyp_bss_end = .;

/*
 * We require that __hyp_bss_start and __bss_start are aligned, and enforce it
 * with an assertion. But the BSS_SECTION macro places an empty .sbss section
 * between them, which can in some cases cause the linker to misalign them. To
 * work around the issue, force a page alignment for __bss_start.
 */
#define SBSS_ALIGN			PAGE_SIZE
#else /* CONFIG_KVM */
#define HYPERVISOR_EXTABLE
#define HYPERVISOR_RODATA_SECTIONS
#define HYPERVISOR_DATA_SECTION
#define HYPERVISOR_PERCPU_SECTION
#define HYPERVISOR_RELOC_SECTION

Annotation

Implementation Notes