arch/arm64/include/asm/elf.h

Source file repositories/reference/linux-study-clean/arch/arm64/include/asm/elf.h

File Facts

System
Linux kernel
Corpus path
arch/arm64/include/asm/elf.h
Extension
.h
Size
8198 bytes
Lines
299
Domain
Architecture Layer
Bucket
arch/arm64
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

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

struct arch_elf_state {
	int flags;
};

#define ARM64_ELF_BTI		(1 << 0)

#define INIT_ARCH_ELF_STATE {			\
	.flags = 0,				\
}

static inline int arch_parse_elf_property(u32 type, const void *data,
					  size_t datasz, bool compat,
					  struct arch_elf_state *arch)
{
	/* No known properties for AArch32 yet */
	if (IS_ENABLED(CONFIG_COMPAT) && compat)
		return 0;

	if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) {
		const u32 *p = data;

		if (datasz != sizeof(*p))
			return -ENOEXEC;

		if (system_supports_bti() &&
		    (*p & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
			arch->flags |= ARM64_ELF_BTI;
	}

	return 0;
}

static inline int arch_elf_pt_proc(void *ehdr, void *phdr,
				   struct file *f, bool is_interp,
				   struct arch_elf_state *state)
{
	return 0;
}

static inline int arch_check_elf(void *ehdr, bool has_interp,
				 void *interp_ehdr,
				 struct arch_elf_state *state)
{
	return 0;
}

#endif /* !__ASSEMBLER__ */

#endif

Annotation

Implementation Notes