]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools/PeCoffLoader: fix handling of ARM MOVW/MOVT instruction relocs
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 9 Oct 2015 18:55:28 +0000 (18:55 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Fri, 9 Oct 2015 18:55:28 +0000 (18:55 +0000)
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/Source/C/Common/PeCoffLoaderEx.c

index 382138a8937e505ddfa79f76943800e0ba1cbc0b..d04fa7d5ba2da5551c051763dcf55a72d0a1c518 100644 (file)
@@ -402,8 +402,8 @@ PeCoffLoaderRelocateArmImage (
     \r
     if (*FixupData != NULL) {\r
       *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));\r
-      *(UINT64 *)(*FixupData) = *Fixup16;\r
       CopyMem (*FixupData, Fixup16, sizeof (UINT64));\r
+      *FixupData = *FixupData + sizeof(UINT64);\r
     }\r
     break;\r
   \r