]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenFw/GenFw.c
BaseTools/GenFw: Enhance GenFw to support PRM GCC build
[mirror_edk2.git] / BaseTools / Source / C / GenFw / GenFw.c
index 8cab70ba4d5f649057a068e842a0b810ec76e0e1..6f61f16788cd2a0a5d66d17228431d8f2b06ad20 100644 (file)
@@ -87,7 +87,7 @@ UINT32 mImageTimeStamp = 0;
 UINT32 mImageSize = 0;\r
 UINT32 mOutImageType = FW_DUMMY_IMAGE;\r
 BOOLEAN mIsConvertXip = FALSE;\r
-\r
+BOOLEAN mExportFlag = FALSE;\r
 \r
 STATIC\r
 EFI_STATUS\r
@@ -279,6 +279,10 @@ Returns:
                         except for -o or -r option. It is a action option.\n\\r
                         If it is combined with other action options, the later\n\\r
                         input action option will override the previous one.\n");\r
+  fprintf (stdout, "  --prm                 Scan symbol section from ELF image and \n\\r
+                        write export table into PE-COFF.\n\\r
+                        This option can be used together with -e.\n\\r
+                        It doesn't work for other options.\n");\r
   fprintf (stdout, "  -v, --verbose         Turn on verbose output with informational messages.\n");\r
   fprintf (stdout, "  -q, --quiet           Disable all messages except key message and fatal error\n");\r
   fprintf (stdout, "  -d, --debug level     Enable debug messages, at input debug level.\n");\r
@@ -1436,6 +1440,20 @@ Returns:
       continue;\r
     }\r
 \r
+    if (stricmp (argv[0], "--prm") == 0) {\r
+      if (stricmp (ModuleType, "DXE_RUNTIME_DRIVER") != 0 ){\r
+        Error (NULL, 0, 1001, "Invalid", "--prm option only supports DXE RUNTIME driver.");\r
+        goto Finish;\r
+      }\r
+\r
+      if (!mExportFlag) {\r
+        mExportFlag = TRUE;\r
+      }\r
+      argc --;\r
+      argv ++;\r
+      continue;\r
+    }\r
+\r
     if (argv[0][0] == '-') {\r
       Error (NULL, 0, 1000, "Unknown option", argv[0]);\r
       goto Finish;\r