From d8c64c3fb8dacbbf7c8dcbc2e394a2f9cfc8bd20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 10 Oct 2022 13:23:26 +0300 Subject: [PATCH] squash: ld: pdb: Switch the --pdb option to required_argument Allow passing an empty parameter to it, to signal an automatically chosen file name. --- ld/emultempl/pe.em | 6 +++--- ld/emultempl/pep.em | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ld/emultempl/pe.em b/ld/emultempl/pe.em index abbee62fd66..2f05303826d 100644 --- a/ld/emultempl/pe.em +++ b/ld/emultempl/pe.em @@ -388,7 +388,7 @@ gld${EMULATION_NAME}_add_options {"tsaware", no_argument, NULL, OPTION_TERMINAL_SERVER_AWARE}, {"disable-tsaware", no_argument, NULL, OPTION_DISABLE_TERMINAL_SERVER_AWARE}, {"build-id", optional_argument, NULL, OPTION_BUILD_ID}, - {"pdb", optional_argument, NULL, OPTION_PDB}, + {"pdb", required_argument, NULL, OPTION_PDB}, {"enable-reloc-section", no_argument, NULL, OPTION_ENABLE_RELOC_SECTION}, {"disable-reloc-section", no_argument, NULL, OPTION_DISABLE_RELOC_SECTION}, {NULL, no_argument, NULL, 0} @@ -538,7 +538,7 @@ gld${EMULATION_NAME}_list_options (FILE *file) fprintf (file, _(" --[disable-]wdmdriver Driver uses the WDM model\n")); fprintf (file, _(" --[disable-]tsaware Image is Terminal Server aware\n")); fprintf (file, _(" --build-id[=STYLE] Generate build ID\n")); - fprintf (file, _(" --pdb[=FILENAME] Generate PDB file\n")); + fprintf (file, _(" --pdb=[FILENAME] Generate PDB file\n")); } /* A case insensitive comparison, regardless of the host platform, used for @@ -983,7 +983,7 @@ gld${EMULATION_NAME}_handle_option (int optc) if (emit_build_id == NULL) emit_build_id = xstrdup (DEFAULT_BUILD_ID_STYLE); pdb = 1; - if (optarg) + if (optarg && optarg[0]) pdb_name = xstrdup (optarg); break; } diff --git a/ld/emultempl/pep.em b/ld/emultempl/pep.em index 11216830dd3..266ea9692c2 100644 --- a/ld/emultempl/pep.em +++ b/ld/emultempl/pep.em @@ -365,7 +365,7 @@ gld${EMULATION_NAME}_add_options {"insert-timestamp", no_argument, NULL, OPTION_INSERT_TIMESTAMP}, {"no-insert-timestamp", no_argument, NULL, OPTION_NO_INSERT_TIMESTAMP}, {"build-id", optional_argument, NULL, OPTION_BUILD_ID}, - {"pdb", optional_argument, NULL, OPTION_PDB}, + {"pdb", required_argument, NULL, OPTION_PDB}, {"enable-reloc-section", no_argument, NULL, OPTION_ENABLE_RELOC_SECTION}, {"disable-reloc-section", no_argument, NULL, OPTION_DISABLE_RELOC_SECTION}, {"disable-high-entropy-va", no_argument, NULL, OPTION_DISABLE_HIGH_ENTROPY_VA}, @@ -513,7 +513,7 @@ gld${EMULATION_NAME}_list_options (FILE *file) fprintf (file, _(" --[disable-]wdmdriver Driver uses the WDM model\n")); fprintf (file, _(" --[disable-]tsaware Image is Terminal Server aware\n")); fprintf (file, _(" --build-id[=STYLE] Generate build ID\n")); - fprintf (file, _(" --pdb[=FILENAME] Generate PDB file\n")); + fprintf (file, _(" --pdb=[FILENAME] Generate PDB file\n")); #endif } @@ -926,7 +926,7 @@ gld${EMULATION_NAME}_handle_option (int optc) if (emit_build_id == NULL) emit_build_id = xstrdup (DEFAULT_BUILD_ID_STYLE); pdb = 1; - if (optarg) + if (optarg && optarg[0]) pdb_name = xstrdup (optarg); break; } -- 2.25.1