From 485b3066542c1278ec32b60a9c905000721256ce Mon Sep 17 00:00:00 2001 From: Ard Biesheuvel Date: Fri, 9 Oct 2015 18:55:41 +0000 Subject: [PATCH] MdePkg/PeCoffLoader: fix handling of ARM MOVW/MOVT instruction relocs Advance the *FixupData pointer after use in the second relocation pass for runtime when handling ARM MOVW/MOVT immediate relocations. Note that using FixupData is somewhat pointless for relocations targeting instructions rather than data items, since the program cannot typically modify its own instructions, and the second pass should be performed unconditionally. But let's just fix it for now. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18597 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c b/MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c index d6bf42738d..38f891e2fd 100644 --- a/MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c +++ b/MdePkg/Library/BasePeCoffLib/Arm/PeCoffLoaderEx.c @@ -234,6 +234,7 @@ PeHotRelocateImageEx ( FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust; ThumbMovwMovtImmediatePatch (Fixup16, FixupVal); } + *FixupData = *FixupData + sizeof(UINT64); break; case EFI_IMAGE_REL_BASED_ARM_MOV32A: