Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efi_loader: fix building crt0 with binutils 2.30+ #11

Open
wants to merge 1 commit into
base: u-boot-2017.03-armada-17.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ S: Maintained
F: include/efi_loader.h
F: lib/efi_loader/
F: cmd/bootefi.c
F: include/pe.h
F: include/asm-generic/pe.h

FLATTENED DEVICE TREE
M: Simon Glass <[email protected]>
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/lib/crt0_aarch64_efi.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* This file is taken and modified from the gnu-efi project.
*/

#include <asm-generic/pe.h>

.section .text.head

/*
Expand Down Expand Up @@ -62,7 +64,7 @@ extra_header_fields:
*/
.long _start - ImageBase /* SizeOfHeaders */
.long 0 /* CheckSum */
.short EFI_SUBSYSTEM /* Subsystem */
.short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */
.short 0 /* DllCharacteristics */
.quad 0 /* SizeOfStackReserve */
.quad 0 /* SizeOfStackCommit */
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/lib/crt0_arm_efi.S
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
* This file is taken and modified from the gnu-efi project.
*/

#include <asm-generic/pe.h>

.section .text.head

/*
Expand Down Expand Up @@ -64,7 +66,7 @@ extra_header_fields:
*/
.long _start - image_base /* SizeOfHeaders */
.long 0 /* CheckSum */
.short EFI_SUBSYSTEM /* Subsystem */
.short IMAGE_SUBSYSTEM_EFI_APPLICATION /* Subsystem */
.short 0 /* DllCharacteristics */
.long 0 /* SizeOfStackReserve */
.long 0 /* SizeOfStackCommit */
Expand Down
21 changes: 21 additions & 0 deletions include/asm-generic/pe.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Portable Executable and Common Object Constants
*
* Copyright (c) 2018 Heinrich Schuchardt
*
* based on the "Microsoft Portable Executable and Common Object File Format
* Specification", revision 11, 2017-01-23
*
* SPDX-License-Identifier: GPL-2.0+
*/

#ifndef _ASM_PE_H
#define _ASM_PE_H

/* Subsystem type */
#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10
#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11
#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12
#define IMAGE_SUBSYSTEM_EFI_ROM 13

#endif /* _ASM_PE_H */
3 changes: 2 additions & 1 deletion include/pe.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#ifndef _PE_H
#define _PE_H

#include <asm-generic/pe.h>

typedef struct _IMAGE_DOS_HEADER {
uint16_t e_magic; /* 00: MZ Header signature */
uint16_t e_cblp; /* 02: Bytes on last page of file */
Expand Down Expand Up @@ -43,7 +45,6 @@ typedef struct _IMAGE_DOS_HEADER {
#define IMAGE_FILE_MACHINE_ARM64 0xaa64
#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b
#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b
#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10

typedef struct _IMAGE_FILE_HEADER {
uint16_t Machine;
Expand Down