Skip to contentSkip to conversation

efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

PATCH New Heinrich Schuchardt 2 participants 4 messages Jul 11, 2019 – Jul 12, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in include/asm-generic/pe.h which is included in include/pe.h. We should not define it twice.

---
 include/pe.h | 1 -
 1 file changed, 1 deletion(-)
include/pe.h +0 -1
index 36e1908b7e..c7aeb2dcb6 100644
@@ -48,7 +48,6 @@ typedef struct _IMAGE_DOS_HEADER {
 
 #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;

--
2.20.1

#1 lore raw

PATCH 1/1 efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

Heinrich,

I wonder why we need "asm-generic/pe.h."
If IMAGE_SUBSYSTEM_EFI_APPLICATION can be arch-specific, why not move other definitions, like * relocation types, too?

-Takahiro Akashi

Quoted 24 lines · Heinrich Schuchardt

IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in include/asm-generic/pe.h which is included in include/pe.h. We should not define it twice.

---
 include/pe.h | 1 -
 1 file changed, 1 deletion(-)
include/pe.h +0 -2
index 36e1908b7e..c7aeb2dcb6 100644
@@ -48,7 +48,6 @@ typedef struct _IMAGE_DOS_HEADER {
 
 #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;
--

2.20.1

#2 lore raw

PATCH 1/1 efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

Quoted 3 lines · AKASHI Takahiro

Heinrich,

I wonder why we need "asm-generic/pe.h".

The assembler cannot understand includes that contain C specific syntax. So we cannot include "pe.h". This is why "asm-generic/pe.h" has been split off.

Quoted 2 lines

If IMAGE_SUBSYSTEM_EFI_APPLICATION can be arch-specific, why not move other definitions, like * relocation types, too?

We need those symbols in include/asm-generic/pe.h that are used by assembler code. IMAGE_SUBSYSTEM_EFI_APPLICATION is not arch-specific but it is used in arch/arm/lib/crt0_arm_efi.S and others.

Best regards

Heinrich

Quoted 29 lines

-Takahiro Akashi

Quoted 24 lines · Heinrich Schuchardt

IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in include/asm-generic/pe.h which is included in include/pe.h. We should not define it twice.

---
  include/pe.h | 1 -
  1 file changed, 1 deletion(-)
include/pe.h +0 -2
index 36e1908b7e..c7aeb2dcb6 100644
@@ -48,7 +48,6 @@ typedef struct _IMAGE_DOS_HEADER {
 
  #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;
--

2.20.1

#3 lore raw

PATCH 1/1 efi_loader: duplicate IMAGE_SUBSYSTEM_EFI_APPLICATION

Quoted 8 lines · Heinrich Schuchardt
Quoted 3 lines · AKASHI Takahiro

Heinrich,

I wonder why we need "asm-generic/pe.h".

The assembler cannot understand includes that contain C specific syntax. So we cannot include "pe.h". This is why "asm-generic/pe.h" has been split off.

If so, why not use "#if(n)def __ASSEMBLY__"?
It is a common usage in lots of headers.

-Takahiro Akashi

Quoted 41 lines
Quoted 2 lines

If IMAGE_SUBSYSTEM_EFI_APPLICATION can be arch-specific, why not move other definitions, like * relocation types, too?

We need those symbols in include/asm-generic/pe.h that are used by assembler code. IMAGE_SUBSYSTEM_EFI_APPLICATION is not arch-specific but it is used in arch/arm/lib/crt0_arm_efi.S and others.

Best regards

Heinrich

Quoted 29 lines

-Takahiro Akashi

Quoted 24 lines · Heinrich Schuchardt

IMAGE_SUBSYSTEM_EFI_APPLICATION is already defined in include/asm-generic/pe.h which is included in include/pe.h. We should not define it twice.

---
 include/pe.h | 1 -
 1 file changed, 1 deletion(-)
include/pe.h +0 -2
index 36e1908b7e..c7aeb2dcb6 100644
@@ -48,7 +48,6 @@ typedef struct _IMAGE_DOS_HEADER {
 
 #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;
--

2.20.1