efi_remap_image(9)
π¦ efi_remap_image(9) π¦
okay bestie, welcome to the Kernel API Manual, and today's main character is efi_remap_image β the function that gives your loaded image the correct permissions for code and data. slay. π
β¨ NAME β¨
efi_remap_image β Remap a loaded image with the appropriate permissions for code and data
πΈ SYNOPSIS πΈ
void efi_remap_image (unsigned long image_base , unsigned alloc_size ,
unsigned long code_size );
π ARGUMENTS π
image_baseβ the base of the image in memory, iykykalloc_sizeβ the size of the area in memory occupied by the imagecode_sizeβ the size of the leading part of the image containing code and read-only data
π DESCRIPTION π
So here's the tea, bestie: efi_remap_image uses the EFI memory attribute protocol to remap the code region of the loaded image read-only/executable, and the remainder read-write/non-executable. no cap. π₯
The code region is assumed to start at the base of the image, and will therefore cover the PE/COFF header as well. it's giving "the header is along for the ride" energy. π«Ά
π SEE ALSO π
Kernel file ./drivers/firmware/efi/libstub/efi-stub-helper.c
efi_parse_options(9), efi_exit_boot_services(9), get_efi_config_table(9), efi_load_initrd_dev_path(9), efi_load_initrd(9), efi_wait_for_key(9)
and that's the whole vibe, periodt. π
this page came from ./drivers/firmware/efi/libstub, dated October 2026 β drink some water, bestie, and go remap something beautiful. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms