[ipxe-devel] [PATCH 1/1] elf2efi.c: provide more help information

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Sep 10 06:37:10 UTC 2017


Indicate if the executable was compiled to create 32- or 64-bit EFI
files.
Enumerate EFI subsystems.
Treat -? like -h.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 src/util/elf2efi.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c
index 27f37d98..a0f3c67c 100644
--- a/src/util/elf2efi.c
+++ b/src/util/elf2efi.c
@@ -953,8 +953,17 @@ static void elf2pe ( const char *elf_name, const char *pe_name,
  * @v program_name	Program name
  */
 static void print_help ( const char *program_name ) {
-	eprintf ( "Syntax: %s [--subsystem=<number>] infile outfile\n",
-		  program_name );
+	eprintf ( "Usage: %s [--subsystem=<number>] infile outfile\n",
+	          program_name );
+#ifdef EFI_TARGET32
+	eprintf ( "Create 32-bit EFI binary.\n" );
+#elif defined(EFI_TARGET64)
+	eprintf ( "Create 64-bit EFI binary.\n" );
+#endif
+	eprintf ( "\nSubsystem:\n"
+		  "\t10\tEFI application, default\n"
+		  "\t11\tEFI boot service driver\n"
+		  "\t12\tEFI runtime driver\n" );
 }
 
 /**
@@ -993,10 +1002,11 @@ static int parse_options ( const int argc, char **argv,
 			}
 			break;
 		case 'h':
+		case '?':
 			print_help ( argv[0] );
 			exit ( 0 );
-		case '?':
 		default:
+			print_help ( argv[0] );
 			exit ( 2 );
 		}
 	}
-- 
2.11.0




More information about the ipxe-devel mailing list