In read_file and get_file_size function, the original efi loader uses AllocatePool to allocate file and file info memory, it's crash on booting due to 4k unaligned pages, should use AllocatePages.
Crash Point:
status = g_st->BootServices->AllocatePool(EfiRuntimeServicesData, file->size, (VOID **)&file->addr); if (EFI_ERROR(status)) { bferror_x64("AllocatePool failed", status); goto allocate_pool_failed; }