summaryrefslogtreecommitdiff
path: root/BaseTools/Source
AgeCommit message (Collapse)Author
2017-02-22VfrCompile: fix invalid comparison between pointer and integerPaolo Bonzini
This would be valid C but is not valid C++, so change the comparison to do what it has always been doing. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2017-02-22BaseTools: add error check for Macro usage in the INF fileYonghong Zhu
Use of MACRO statements in the EDK II INF files is limited to local usage only; global or external macros are not permitted. This patch add the check for not defined macros. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-17BaseTools: Fix bug for GUIDED tool path override by DSC [BuildOptions]Yonghong Zhu
Current the GUIDED tool path can't be override to the different path in the [BuildOptions] of DSC file. This patch fix the bug. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=283 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-14BaseTools: Enhance BaseTools supports FixedAtBuild usage in VFR fileYonghong Zhu
This patch is to update BaseTools generate Fixed PCD APIs and Value into $(MODULE_NAME)StrDefs.h for VFR only. If the module has VFR files, and it directly consumes FixedAtBuild PCD, BaseTool will generate those FixedAtBuild PCD value into its $(MODULE_NAME)StrDefs.h. FixedPcdGetXX macro are always generated. Every FixedPcd _PCD_VALUE_PcdName will be generated without the postfix U or UL or ULL. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=348 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-08BaseTools: Fix the bug to parse the short varname in map fileYonghong Zhu
current in the map file, there have two ways for var to save its offset, if the varname is short, then the offset will in the same line with varname, otherwise, it saved in the next line. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-23BaseTools: Convert incomplete expression with dangling while()Nikolai SAOUKH
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Nikolai SAOUKH <nms@otdel-1.org> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-23BaseTools: Extend the Macro used in the FDF !include statementYonghong Zhu
Current it only support the system environment variables in the !include statement, $(WORKSPACE), $(PACKAGES_PATH), $(EFI_SOURCE), $(EDK_SOURCE), $(ECP_SOURCE), this patch extend the usage to support the Global macros and the macro which defined before the statement. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-06BaseTools: not report error for the optional items in the FmpTokensYonghong Zhu
<FmpTokens> in the FDF spec defined some optional items, eg: IMAGE_INDEX, HARDWARE_INSTANCE. but current tool report error if no such item is exist in the FDF file. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=293 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-04BaseTools: fix the bug for Mixed Pcd display in the reportYonghong Zhu
Fix the bug to not display the mixed PCD in the Global PCD section, and correct the Pcd display name. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-29BaseTools: Fix the bug for RAW file alignment value supportYonghong Zhu
Fix the bug for RAW file to support Align=32 and Align=64. Current FDF spec FfsAlignmentValues support this two values, while it is not the valid value for GenFfs. So this patch add the logic to handle it. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=248 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-29BaseTools/Ecc: Fix the issue of not recognizing "FILE_GUID"Hess Chen
Fix the issue of not recognizing "FILE_GUID" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2016-12-23BaseTools/Pccts: Resolve GCC sting format mismatch build warningHao Wu
https://bugzilla.tianocore.org/show_bug.cgi?id=282 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-20BaseTools GCC makefile: disable unused-result warning for CPP fileLiming Gao
This warning has been disabled for C file. To be same, it is also disabled for CPP file. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2016-12-20BaseTools: fix write-strings build warningsHeyi Guo
Fix build warnings of "deprecated conversion from string constant to ?CHAR8* {aka char*}? [-Wwrite-strings]" for BaseTools, while using "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-20BaseTools: fix format type build warningsHeyi Guo
Fix build warnings of "format ?%d? expects argument of type ?int?, but argument 5 has type ?long unsigned int? [-Wformat=]" for BaseTools, while using "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-20BaseTools: fix format-security build warningsHeyi Guo
Fix build warnings of "format not a string literal and no format arguments [-Wformat-security]" for BaseTools, while using "gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3)". Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-05BaseTools/VolInfo: Fix printf issue using '%ls' in format stringHao Wu
https://bugzilla.tianocore.org/show_bug.cgi?id=257 For GCC compilers, when building with option '-fshort-wchar', wide char string format '%ls' does not work properly for printf() function. The string specified by '%ls' will not be printed. This commit avoids using '%ls' for printf() function and converts the wide char string to char string for printing. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-02BaseTools: Support QuotedString for PREBUILD/POSTBUILD in DSC fileYonghong Zhu
If the prebuild/postbuild script statement start with double quotations, current tool report error, while DSC spec allow this usage. so update tool to support it. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-02BaseTools: Fix the bug to parse the new map file formatYonghong Zhu
Current the variable and Pcd format save in the map file is changed, so this patch is to support this new format. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-12-02BaseTools: add error check for "#image" for idf file formatYonghong Zhu
Add new error check for "#image" keyword used in the image definition file. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-30BaseTools: fix the bug to add PaletteSize info into AutoGenYonghong Zhu
Fix the bug to add PaletteSize info into AutoGen.c when the flag UEFI_HII_RESOURCE_SECTION is set to FALSE. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-30BaseTools CommonLib: Update ReadMemoryFileLine() to read line in file scopeLiming Gao
https://bugzilla.tianocore.org/show_bug.cgi?id=255 Check CurrentFilePointer to make sure it not exceed the end of file. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
2016-11-29BaseTools: Fix bug for decimal value of VPDPCD offset display in reportYonghong Zhu
current if we set VPD PCD's offset to a decimal value, eg: 22, this value is displayed incorrectly in the "FD VPD Region" section in the report.txt. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-23BaseTools: report error for same Guid's Private definition conflictYonghong Zhu
Add error check for the same Guid/Protocol/PPIs/Includes defined as both Private and non-Private attribute. Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=209 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-15BaseTools: FILE DATA to support relative path under Multiple workspaceYonghong Zhu
Fix the bug that FILE DATA to support relative path under Multiple workspace. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-15BaseTools: Fix the bug to support generate FFS by Align=AutoYonghong Zhu
FDF spec support to use 'Auto' as <FfsAlignmentValues>, but current Tool report error about -a=Auto is invalid option when we set Align=Auto for RAW File. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-10BaseTools/GenSec: Return correct status when input file size is 0Hao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-10BaseTools/GenFfs: Fix return too early when input file is of size 0Hao Wu
Commit 2cb874352423fcfd180199e6de8298567dff8e7f eliminates possible NULL pointer dereference in GenFfs tool source codes. However, it doesn't correctly handle the case when the input file is of size 0. This will lead to possible build issues. This commits refine the logic to handle the above case. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-09BaseTools/PeCoffLib: Check 'RelocDir' before finding relocation blockHao Wu
To match the code logics in MdePkg/Library/BasePeCoffLib, add checks for 'RelocDir' before finding the relocation block. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VfrCompile/Pccts: Make assignment operator not returning voidHao Wu
The assignment operators for class ANTLRTokenPtr return void in current code. This commit makes them return the reference to the object just like primitive types do. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VfrCompile/Pccts: Add virtual destructor for class DLGInputStreamHao Wu
Class DLGInputStream defined in DLexerBase.h has a virtual method but no virtual destructor. This commit add an empty virtual destructor to avoid potential memory/resource leak when an object of a class derived from class DLGInputStream is deleted through a pointer to the DLGInputStream class. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VolInfo: Add definitions for command format stringsHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VfrCompile: Explicitly state format string for DebugMsg()Hao Wu
For calls to API DebugMsg(), explicitly state format string as "%s" when the given variable list is a sting. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VolInfo: Provide string width in '%s' specifier in format stringHao Wu
String width is not specified for '%s' specifier in the format string for scanf functions. This commit now specifies the string length for '%s' in format strings according to the size of receiving buffers. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenVtf: Provide string width in '%s' specifier in format stringHao Wu
String width is not specified for '%s' specifier in the format string for scanf functions. This commit now specifies the string length for '%s' in format strings according to the size of receiving buffers. Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VolInfo: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/TianoCompress: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/LzmaCompress: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenVtf: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenFv: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenCrc32: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenBootSector: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/EfiRom: Fix file handles not being closedHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VolInfo: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/VfrCompile: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/TianoCompress: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/Split: Fix potential memory and resource leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenVtf: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenSec: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-08BaseTools/GenPage: Fix potential memory leakHao Wu
Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>