summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/C/Common
Commit message (Collapse)AuthorAgeFilesLines
* BaseTools/CommonLib.h: Build failed due to MAX_LONG_FILE_PATHEnze Zhu2021-01-061-0/+8
| | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3032 We had a build fail due to the hard coded MAX_LONG_FILE_PATH value. We should use PATH_MAX if it is available. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Signed-off-by: Enze Zhu <zhuenze@byosoft.com.cn> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix PcdValueInit tool build issue with VS compiler x64Bob Feng2020-10-261-1/+1
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3001 When the 64-bit version of VS compiler is used, the generated PcdValueInit tool will be failed to compile. This patch is going to fix that issue. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* BaseTools/PeCoffLoaderEx: Remove the unused local variableAbner Chang2020-07-291-3/+0
| | | | | | | | | | | | | BZ:2864 GCC build fails due to variable self assignment. This local variable is not used at any where, we can just remove it. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: BaseTools changes for RISC-V platform.Abner Chang2020-04-293-1/+109
| | | | | | | | | | | | | | | C code changes for building EDK2 RISC-V platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Co-authored-by: Gilbert Chen <gilbert.chen@hpe.com> Co-authored-by: Daniel Helmut Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Bob Feng <bob.c.feng@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com>
* BaseTools/PcdValueCommon: Fix 64-bit host compiler errorSean Brogan2020-02-071-1/+1
| | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2496 Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/Build: Do not use Common.lib in Structured PCD appKinney, Michael D2020-02-072-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2496 Reduce the build and env dependencies for the Structured PCD application by removing the dependency on Common.lib that is only built when BaseTools is built which does not happen if pre-compiled BaseToools are used. Change the makefile for the Structure PCD application to build all files from sources which adds PcdValueCommon.c to the makefile. Also remove PcdValueCommon.c from Common.lib. With the change to the makefile for the Structured PCD application, multiple C files are compiled. Only PcdValueInit.c contains the extra information expected by the error/warning message parser. Only parse the DSC line number into an error message if there is an error/warning in PcdValueInit.c. Errors/warnings in other files should be passed through. This fixes a build failure with no useful log information that was observed when there was a compiler error in PcdValueCommon.c. Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Fix various typosAntoine Cœur2019-07-081-2/+2
| | | | | | | Fix various typos in BaseTools. Signed-off-by: Cœur <coeur@gmx.fr> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-0939-273/+39
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
* BaseTools/C/Common: Improve performance of boundary validationShenglei Zhang2019-03-271-3/+4
| | | | | | | | | | | | | | The boundary validation checking in MakeTable() performs on every loop iteration. This could be improved by checking just once before the loop. https://bugzilla.tianocore.org/show_bug.cgi?id=1329 Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add parameter check for the AsciiStringToUint64Feng, Bob C2019-02-251-1/+1
| | | | | | | | | | | | If the input parameter AsciiString length is greater than 255, the GenFv will hang. This patch is to fix this issue. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Various typoAntoine Coeur2019-02-1421-52/+52
| | | | | | | | Various typo in BaseTools. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Remove unused logic from C toolsFeng, Bob C2019-01-142-174/+2
| | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1350 Remove IA64 support from BaseTools C code. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com>
* BaseTools/CommonLib: drop the use of MAX_ADDRESSArd Biesheuvel2018-12-061-1/+0
| | | | | | | | | | | | | | | | | | | The macro MAX_ADDRESS represents the largest virtual address that is valid for a certain architecture. For the BaseTools, this quantity is irrelevant, since the same tools can be used to build for different targets. Since we only refer to it in a single place, which is an ASSERT() that doesn't seem particularly useful (it ensures that memcpy() will not be called with arguments that will make it read beyond the end of the address space and wrap around), let's drop the ASSERT and all references to MAX_ADDRESS. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/CommonLib: drop definition of MAX_UINTNArd Biesheuvel2018-12-051-1/+0
| | | | | | | | | | | | | | The maximum value that can be represented by the native word size of the *target* should be irrelevant when compiling tools that run on the build *host*. So drop the definition of MAX_UINTN, now that we no longer use it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/CommonLib: get rid of 'native' type string parsing routinesArd Biesheuvel2018-12-052-193/+5
| | | | | | | | | | | | | Parsing a string into an integer variable of the native word size is not defined for the BaseTools, since the same tools may be used to build firmware for different targets with different native word sizes. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/CommonLib: add definition of MAX_UINT32Ard Biesheuvel2018-12-051-0/+1
| | | | | | | | | | Since we will be dropping the definition of MAX_UINTN, whose meaning is ambiguous for the BaseTools, add a definition of MAX_UINT32 that we can switch to. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/CommonLib: use explicit 64-bit type in Strtoi()Ard Biesheuvel2018-12-051-2/+2
| | | | | | | | | | | | | | | | Don't use the native word size string to number parsing routines, but instead, use the 64-bit one and cast to UINTN. Currently, the only user is in Source/C/DevicePath/DevicePathFromText.c which takes care to use Strtoi64 () unless it assumes the value fits in 32-bit, so this change is a no-op even on 32-bit build hosts. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/CommonLib: avoid using 'native' word size in IP address handlingArd Biesheuvel2018-12-051-14/+14
| | | | | | | | | | | | | | | In the context of the BaseTools, there is no such thing as a native word size, given that the same set of tools may be used to build a firmware image consisting of both 32-bit and 64-bit modules. So update StrToIpv4Address() and StrToIpv6Address() to use UINT64 types instead of UINTN types when parsing strings. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix UEFI and Tiano Decompression logic issueLiming Gao2018-11-111-0/+6
| | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1317 This is a regression issue caused by 041d89bc0f0119df37a5fce1d0f16495ff905089. In Decode() function, once mOutBuf is fully filled, Decode() should return. Current logic misses the checker of mOutBuf after while() loop. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add more checker in Decompress algorithm to access the valid ↵Liming Gao2018-10-241-2/+21
| | | | | | | | | | | | | buffer (CVE FIX) Fix CVE-2017-5731,CVE-2017-5732,CVE-2017-5733,CVE-2017-5734,CVE-2017-5735 https://bugzilla.tianocore.org/show_bug.cgi?id=686 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Holtsclaw Brent <brent.holtsclaw@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
* BaseTools: add ASSERT checker for array buffer value assignment.Zhaozh1x2018-10-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | V3: Update the error message for array checker. V2: 1. Add comments for each ASSERT. 2. ASSERT need to skip the case of array size of array as zero. For example, TestArray[] in struct in header file. V1: For structure PCD, 1. use compiler time assert to check the array index, report error if array index exceeds the array number. 2. use compiler time assert to check the array size, report error if the user declared size in header file is smaller than the user defined in DEC/DSC file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: ZhiqiangX Zhao <zhiqiangx.zhao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Clean up source filesLiming Gao2018-07-0931-727/+727
| | | | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools GNUmakefile: Remove HOST_ARCH in every tool MakefileLiming Gao2018-02-061-2/+1
| | | | | | | HOST_ARCH has been moved into the common header.makefile Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix make PcdValueCommon.c failure on GCCFeng, YunhuaX2018-02-021-2/+1
| | | | | | | | | | | | | | | | error message: PcdValueCommon.c: In function '__PcdGetPtr': PcdValueCommon.c:315:11: error: variable 'Byte' set but not used [-Werror=unused-but-set-variable] UINT8 Byte; ^ cc1: all warnings being treated as errors Cc: Liming Gao <liming.gao@intel.com> Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools CommonLib: Remove the unnecessary print message in PcdValueCommonLiming Gao2018-02-011-10/+0
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: CommonLib Fix Crash to write the last byteLiming Gao2018-01-251-1/+1
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/C/Common: Fix potential null pointer dereferenceHao Wu2018-01-151-0/+7
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/C/Common: Fix potential memory leakHao Wu2018-01-151-1/+4
| | | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/C/Common: Fix code to be more readableHao Wu2018-01-151-2/+2
| | | | | | | | | | The change doesn't impact the functionality. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Fix compile error on VS2010Yonghong Zhu2018-01-031-3/+2
| | | | | | | | VS2010 also defined RSIZE_MAX, so we undef it first. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools CommonLib: Fix printf %llx issue on UINT64Liming Gao2018-01-031-5/+1
| | | | | | | | | | UINT64 is defined as the different type for the different ARCHs. To let it work for all archs and compilers, add (unsigned long long) for the input value together with %llx. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Add DevicePath support for PCD valuesYonghong Zhu2017-12-312-3/+1930
| | | | | | | | | | | | Use C code parse device path to output hex string, and Python run command when PCD Value need device path parse. https://bugzilla.tianocore.org/show_bug.cgi?id=541 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng <yunhuax.feng@intel.com> Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Add PcdValueCommon logic into C source CommonLibLiming Gao2017-12-254-2/+978
| | | | | | | | PcdValueCommon is used to calculate structure pcd value. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools/C/Common: Refine using sprintf() with '%s' in format stringHao Wu2017-12-251-9/+12
| | | | | | | | | | | The commit removes the usages of sprintf() function calls with '%s' in the format string. And uses strncpy/strncat instead to ensure the destination string buffers will not be accessed beyond their boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/C/Common: Add/refine boundary checks for strcpy/strcat callsHao Wu2017-12-252-13/+20
| | | | | | | | | | | Add checks to ensure when the destination string buffer is of fixed size, the strcpy/strcat functions calls will not access beyond the boundary. Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/C/Common: Remove redundant type castHao Wu2017-12-251-7/+5
| | | | | | | Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/C/Common: Add checks for array accessHao Wu2017-12-252-11/+9
| | | | | | | Cc: Yonghong Zhu <yonghong.zhu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools: Replace ARCH with HOST_ARCH in C Makefile to avoid conflictLiming Gao2017-11-301-1/+1
| | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=793 ARCH is too generic. It may cause confuse of target arch or host arch. To be clarified, replace it with HOST_ARCH in BaseTools C Makefile. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools: Fix Xcode 9 Beta treating 32-bit left shift as undefinedYonghong Zhu2017-08-111-2/+2
| | | | | | | | | | Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=635 Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Andrew Fish <afish@apple.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools CommonLib: Update ReadMemoryFileLine() to read line in file scopeLiming Gao2016-11-301-0/+3
| | | | | | | | | | | 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>
* BaseTools/PeCoffLib: Check 'RelocDir' before finding relocation blockHao Wu2016-11-091-16/+30
| | | | | | | | | | | 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>
* BaseTools/C/Common: Fix potential memory leakHao Wu2016-11-084-10/+34
| | | | | | | | 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>
* BaseTools/C/Common: Add checks for array accessHao Wu2016-11-082-4/+11
| | | | | | | | 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>
* BaseTools/C/Common: Fix parameter format mismatch in scanf functionsHao Wu2016-11-082-8/+8
| | | | | | | | | | | | | According to MSDN https://msdn.microsoft.com/en-us/library/6ttkkkhh.aspx Format specification '%x' for scanf expects type 'int *', modify the type of the relating variable to 'int' to keep them matched. 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>
* BaseTools/C/Common: Avoid possible NULL pointer dereferenceHao Wu2016-11-086-23/+93
| | | | | | | | 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>
* BaseTools: Fix typos in comments and variablesGary Lin2016-10-203-6/+6
| | | | | | | | | | | | | | | | - Pacakge -> Package - outputed -> outputted - successull -> successfully - Libary -> Library - Pointion -> Position - paramter -> parameter Cc: Yonghong Zhu <yonghong.zhu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Gary Lin <glin@suse.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
* BaseTools PeCoffLib: Fix the issue to get RelocationsStripped from TE imageLiming Gao2016-08-221-2/+2
| | | | | | | | | | | | | | | If PE image has no relocation section, and has not set RELOCS_STRIPPED, after it is converted to TE image, GenFw will set its relocation section VirtualAddress to non-zero address, and keep Size value as Zero. MdePkg BasePeCoffLib applied this rule to get RelocationsStripped attribute. But, it is missing in BaseTools BasePeCoffLib. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> 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> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* BaseTools: Eliminate two shift-negative-value in FvLib.cZenith4322016-05-181-2/+2
| | | | | | | | | | | clang 3.8 flags -Wshift-negative-value warning, which turns fatal due to use of -Werror. Fixes: https://github.com/tianocore/edk2/issues/49 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zenith432 <zenith432@users.sourceforge.net> Reviewed-by: Liming Gao <liming.gao@intel.com>
* BaseTools/PeCoffLoader: fix handling of ARM MOVW/MOVT instruction relocsArd Biesheuvel2015-10-091-1/+1
| | | | | | | | | | | | | | The handling of ARM MOVW/MOVT relocations sets the FixupData twice (once incorrectly), but fails to advance the *FixupData pointer afterwards. This is not actually a problem, since the fixup data is never used but let's fix it anyway in case anyone reuses this code. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18596 6f19259b-4bc3-4df7-8a09-765794883524
* BaseTools: Follow PI spec to update ExtendedSize in EFI_FFS_FILE_HEADER2Star Zeng2015-08-242-4/+4
| | | | | | | | | | | | | | | | for FFS data above 16 bytes alignment requirement. PI spec requires FFS header to be at 8 bytes alignment to FV header. And, FFS data alignment requires the beginning of the file data must be aligned on a particular boundary, such as 1, 16, 128 bytes or above. If FFS data alignment requires to be above 16 bytes, and FFS header must be at 8 byte alignment, so FFS header size must be multiple of 8. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18262 6f19259b-4bc3-4df7-8a09-765794883524