summaryrefslogtreecommitdiff
path: root/src/zap/zaprelocs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zap/zaprelocs.cpp')
-rw-r--r--src/zap/zaprelocs.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/zap/zaprelocs.cpp b/src/zap/zaprelocs.cpp
index 04708c2adb..059d9a59ac 100644
--- a/src/zap/zaprelocs.cpp
+++ b/src/zap/zaprelocs.cpp
@@ -84,6 +84,22 @@ void ZapBaseRelocs::WriteReloc(PVOID pSrc, int offset, ZapNode * pTarget, int ta
break;
}
+ case IMAGE_REL_BASED_REL_THUMB_MOV32_PCREL:
+ {
+ TADDR pSite = (TADDR)m_pImage->GetBaseAddress() + rva;
+
+ // For details about how the value is calculated, see
+ // description of IMAGE_REL_BASED_REL_THUMB_MOV32_PCREL
+ const UINT32 offsetCorrection = 12;
+
+ UINT32 imm32 = pActualTarget - (pSite + offsetCorrection);
+
+ PutThumb2Mov32((UINT16 *)pLocation, imm32);
+
+ // IMAGE_REL_BASED_REL_THUMB_MOV32_PCREL does not need base reloc entry
+ return;
+ }
+
case IMAGE_REL_BASED_THUMB_BRANCH24:
{
TADDR pSite = (TADDR)m_pImage->GetBaseAddress() + rva;
@@ -282,6 +298,7 @@ void ZapBlobWithRelocs::Save(ZapWriter * pZapWriter)
#if defined(_TARGET_ARM_)
case IMAGE_REL_BASED_THUMB_MOV32:
+ case IMAGE_REL_BASED_REL_THUMB_MOV32_PCREL:
targetOffset = (int)GetThumb2Mov32((UINT16 *)pLocation);
break;