/* Performs an ARM-based specific relocation fixup and is a no-op on other instruction sets. */
RETURN_STATUS PeCoffLoaderRelocateArmImage(IN UINT16 **Reloc, IN OUT CHAR8 *Fixup, IN OUT CHAR8 **FixupData, IN UINT64 Adjust)
/* Performs an ARM-based specific relocation fixup and is a no-op on other instruction sets. */
RETURN_STATUS PeCoffLoaderRelocateArmImage(IN UINT16 **Reloc, IN OUT CHAR8 *Fixup, IN OUT CHAR8 **FixupData, IN UINT64 Adjust)
{
  UINT16      *Fixup16;
  UINT32      FixupVal;
  Fixup16   = (UINT16 *) Fixup;
  switch ((**Reloc) >> 12) {
  case EFI_IMAGE_REL_BASED_ARM_MOV32T:
    FixupVal = ThumbMovwMovtImmediateAddress (Fixup16) + (UINT32)Adjust;
    ThumbMovwMovtImmediatePatch (Fixup16, FixupVal);
    if (*FixupData != NULL) {
      *FixupData = ALIGN_POINTER(*FixupData, sizeof(UINT64));
      CopyMem (*FixupData, Fixup16, sizeof (UINT64));
      *FixupData = *FixupData + sizeof(UINT64);
    }
    break;
  case EFI_IMAGE_REL_BASED_ARM_MOV32A:
  default:
    return RETURN_UNSUPPORTED;
  }
  return RETURN_SUCCESS;
}