work on PackLinuxElf32arm; add nrv2b_d8.S

This commit is contained in:
John Reiser
2006-07-21 13:11:02 -07:00
parent 436532bed7
commit 52e8326d54
8 changed files with 1393 additions and 1054 deletions
+28
View File
@@ -903,6 +903,34 @@ void ElfLinkerArmLE::relocate1(Relocation *rel, upx_byte *location,
super::relocate1(rel, location, value, type);
}
void ElfLinkerArmBE::relocate1(Relocation *rel, upx_byte *location,
unsigned value, const char *type)
{
if (strcmp(type, "R_ARM_PC24") == 0)
{
value -= rel->section->offset + rel->offset;
set_be24(1+ location, get_be24(1+ location) + value / 4);
}
else if (strcmp(type, "R_ARM_ABS32") == 0)
{
set_be32(location, get_be32(location) + value);
}
else if (strcmp(type, "R_ARM_THM_CALL") == 0)
{
value -= rel->section->offset + rel->offset;
value += ((get_be16(location) & 0x7ff) << 12);
value += (get_be16(location + 2) & 0x7ff) << 1;
set_be16(location, 0xf000 + ((value >> 12) & 0x7ff));
set_be16(location + 2, 0xf800 + ((value >> 1) & 0x7ff));
//(b, 0xF000 + ((v - 1) / 2) * 0x10000);
//set_be32(location, get_be32(location) + value / 4);
}
else
super::relocate1(rel, location, value, type);
}
/*
vi:ts=4:et