summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
AgeCommit message (Collapse)Author
2017-09-05Remove core packages since we can get them from edk2 repositoryGuo Mang
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Mang <mang.guo@intel.com>
2014-03-25Support load 64 bit image from 32 bit core.Eric Dong
Add more enhancement to check invalid PE format. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen, Yao <jiewen.yao@intel.com> Reviewed-by: Liming, Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15387 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-12Add more check for PE COFF SizeOfHeader field.jyao1
Signed-off by: jiewen yao <jiewen.yao@intel.com> reviewed by: eric dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15233 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-26Checks the TE image before use it.ydong10
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Yao, Jiewen <jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14024 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-06Remove the ASSERT (FALSE) code, just return unsupported.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13985 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-28Enhance the check for RelocBase->SizeOfBlock before use it.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13973 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-28Enhance the check for some fields in the PE image before use it.ydong10
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao<jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13972 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-26Enhance the check for resource section data.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13962 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-26Enhance the check for debug data before get the PdbPointer.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13961 6f19259b-4bc3-4df7-8a09-765794883524
2012-11-20Remove the useless code.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13954 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-11Enhance the error code info.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13716 6f19259b-4bc3-4df7-8a09-765794883524
2012-09-11Enhance the comments.ydong10
Signed-off-by: Dong Eric <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13715 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-22Enhance the check for some fields in the PE image before use it.ydong10
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao<jiewen.yao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13665 6f19259b-4bc3-4df7-8a09-765794883524
2012-08-21Enhance the check when ImageRead function return.ydong10
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13657 6f19259b-4bc3-4df7-8a09-765794883524
2012-06-12Add comment for modules which have external input.jyao1
signed-off-by: jiewen.yao@intel.com reviewed-by: guo.dong@intel.com reviewed-by: ting.ye@intel.com reviewed-by: liming.gao@intel.com reviewed-by: elvin.li@intel.com git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13446 6f19259b-4bc3-4df7-8a09-765794883524
2012-05-04Update the logic related to get section header offset for TE image.ydong10
Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13273 6f19259b-4bc3-4df7-8a09-765794883524
2012-04-26Patch include:ydong10
1.Change function name to avoid name conflict. 2.Refine check for Pe Image. Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13220 6f19259b-4bc3-4df7-8a09-765794883524
2012-04-24Validate some fields in PE image to make sure not access violation for later ↵ydong10
code. Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13211 6f19259b-4bc3-4df7-8a09-765794883524
2012-03-16Update the offset when read every debug entries info.ydong10
Signed-off-by: ydong10 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13104 6f19259b-4bc3-4df7-8a09-765794883524
2011-07-12MdePkg: Fix X64 clang compile issues.andrewfish
Fixed issues with X64 clang, and also make StackSwitch push a zero on the new stack to prevent a stack unwind into memory that is no longer valid. signed-off-by: andrewfish reviewed-by: lgao4 reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12007 6f19259b-4bc3-4df7-8a09-765794883524
2011-02-16Per PI1.2B spec, for the case that TE Image Relocation Data Directory Entry ↵lgao4
Virtual Address is non-zero, but the Relocation Data Directory Size is zero, BasePeCoffLib should only handle such case as PIC TE image. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11315 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-30Minor grammatical work--mostly adding periods. Items with ONLY period added ↵myronporter
did not have the heading date changed, but Items with content changes had heading copyright dates updated. Sending separately a list of files missing Doxygen @param and @return information. (PENDING) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10615 6f19259b-4bc3-4df7-8a09-765794883524
2010-06-25Minor grammatical work--mostly adding periods. Items with ONLY period added ↵myronporter
did not have the heading date changed, but Items with content changes had heading copyright dates updated. Sending separately a list of files missing Doxygen @param and @return information. (PENDING) git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10604 6f19259b-4bc3-4df7-8a09-765794883524
2010-04-23Update the copyright notice formathhtian
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10412 6f19259b-4bc3-4df7-8a09-765794883524
2009-10-15Do not update the ImageBase in the PE/COFF header if Adjust is 0.mdkinney
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9341 6f19259b-4bc3-4df7-8a09-765794883524
2009-10-08Do not apply relocation fixups if the Adjust value is zero, which means the ↵mdkinney
image is XIP. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9333 6f19259b-4bc3-4df7-8a09-765794883524
2009-10-01Check to see if the section size of non-zero before failing a load operation ↵mdkinney
due to a NULL base or end address git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9326 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-24Fix file headersmdkinney
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9189 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-19Remove tabs in source code in MdePkg.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9142 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-19Update to make end-of-line consistent for all source files in MdePkg. There ↵qhuang8
are no other updates besides that change. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9141 6f19259b-4bc3-4df7-8a09-765794883524
2009-08-18Add ARM supportmdkinney
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9111 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-11add the extra comments into BasePeCoffRelocateImage, BasePeCoffLoadImage and ↵eric_tian
BasePeCoffRelocateImageForRuntime to help user to know the usage model of these APIs. The comments mainly used to clarify it's caller's responsibility to to perform cache maintenance operations git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8283 6f19259b-4bc3-4df7-8a09-765794883524
2009-05-06Update BasePeCoff to Initialize the debug field to zero.lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8243 6f19259b-4bc3-4df7-8a09-765794883524
2009-04-23Add check for the validity of resource directory address.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8164 6f19259b-4bc3-4df7-8a09-765794883524
2009-04-22Add HiiResourceData field to PeCoffLib library class. PeCoffLoaderLoadImage ↵qhuang8
() will set this field to HII resource data if it detects the existence in PE image. otherwise, it set that field to 0. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8141 6f19259b-4bc3-4df7-8a09-765794883524
2009-03-05Remove PeRemove PeiPeCoffLoader.h and gPeiPeCoffLoaderGuid, and Add ↵qhuang8
PeCoffExtraActionLib class and instances. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7811 6f19259b-4bc3-4df7-8a09-765794883524
2009-02-051) Remove UEFI specific defines from IndustryStandard/PeImage.hmdkinney
2) Add UEFI specific defines to Uefi/UefiBaseType.h 3) Update Base PE/COFF related libs to only use defines from IndustryStandard/PeImage.h git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7438 6f19259b-4bc3-4df7-8a09-765794883524
2009-01-07Add check for Zero Relocation section.lgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7197 6f19259b-4bc3-4df7-8a09-765794883524
2009-01-04Temporarily remove the assertions and we may find some error handling way to ↵qhuang8
address potential dereference to NULL pointer. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7173 6f19259b-4bc3-4df7-8a09-765794883524
2008-12-31Add some ASSERT()s to avoid NULL reference.gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7162 6f19259b-4bc3-4df7-8a09-765794883524
2008-12-11Synchronize MdePkg h files to Library/Base* c files.gikidy
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6984 6f19259b-4bc3-4df7-8a09-765794883524
2008-12-05Update the text to use "x64" instead of "X64" in MdePkg.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6854 6f19259b-4bc3-4df7-8a09-765794883524
2008-12-04Follow the Mde_Lib_Spec to fix the function PeCoffLoaderUnloadImage() IN/OUT ↵gikidy
issue about definition and implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6825 6f19259b-4bc3-4df7-8a09-765794883524
2008-11-27Add several missing assertions.qhuang8
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6766 6f19259b-4bc3-4df7-8a09-765794883524
2008-11-26Function headers in .h and .c files synchronized with specjji4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6731 6f19259b-4bc3-4df7-8a09-765794883524
2008-10-24Fix ECC issueklu2
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6214 6f19259b-4bc3-4df7-8a09-765794883524
2008-10-10Update HobLib and PeCoffLib according to MDE Lib Spec 0.61clgao4
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6100 6f19259b-4bc3-4df7-8a09-765794883524
2008-09-181. Change 0 == Length style to Length == 0lgao4
2. Clean BasePeCoff library instance, only keep one copy PeCoffLoaderEx.c file for IA32, X64 and IPF arch 3. Clean the confused comments git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5927 6f19259b-4bc3-4df7-8a09-765794883524
2008-09-17remove unnecessary comments introduced by tools from MdePkg. The regular ↵vanjeff
express is "//^p//[ ]Include[ ]common[ ]header[ ]file[ ]for[ ]this[ ]module[.]^p//" git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5911 6f19259b-4bc3-4df7-8a09-765794883524
2008-07-17Correct ECC Error for MdePkg/Include/Protocol and Correct PeCofferLib bug to ↵lgao4
set ImageContext->EntryPoint after relocate when the destination address is specified. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5514 6f19259b-4bc3-4df7-8a09-765794883524