From eeab1aef64ced9438d4c797624707b222602d345 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Thu, 22 Oct 2009 21:05:05 -0700 Subject: [PATCH] Synonyms R_ARM_THM_PC22 and R_ARM_THM_XPC22 for R_ARM_THM_CALL. --- src/linker.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/linker.cpp b/src/linker.cpp index 350bb4e4..64c8ead0 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -679,7 +679,10 @@ void ElfLinkerArmBE::relocate1(const Relocation *rel, upx_byte *location, { set_be32(location, get_be32(location) + value); } - else if (strcmp(type, "R_ARM_THM_CALL") == 0) + else if (strcmp(type, "R_ARM_THM_CALL") == 0 + || strcmp(type, "R_ARM_THM_XPC22") == 0 + || strcmp(type, "R_ARM_THM_PC22") == 0 + ) { value -= rel->section->offset + rel->offset; value += ((get_be16(location) & 0x7ff) << 12); @@ -711,7 +714,10 @@ void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, { set_le32(location, get_le32(location) + value); } - else if (strcmp(type, "R_ARM_THM_CALL") == 0) + else if (strcmp(type, "R_ARM_THM_CALL") == 0 + || strcmp(type, "R_ARM_THM_XPC22") == 0 + || strcmp(type, "R_ARM_THM_PC22") == 0 + ) { value -= rel->section->offset + rel->offset; value += ((get_le16(location) & 0x7ff) << 12);