Skip to content

EFI images have wrong machine type for 32-bit ARM #167556

@maharmstone

Description

@maharmstone

Using the triplet thumbv7-w64-mingw32 and (e.g.) -Wl,--subsystem,efi_boot_service_driver you can create EFI images for 32-bit ARM, but these don't load without a bit of tweaking. EFI is expecting an image type of IMAGE_FILE_MACHINE_ARMTHUMB_MIXED (0x1c2), but lld is outputting IMAGE_FILE_MACHINE_ARMNT, 0x1c4, which I believe is what 32-bit ARM Windows uses. See also the gnu-efi linker script for this: https://github.com/rhboot/gnu-efi/blob/master/gnuefi/crt0-efi-arm.S

If lld gets passed a subsystem which begins with "efi_", it should be outputting a machine type of 0x1c2 rather than 0x1c4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions