Some linker.cpp cleanups.

This commit is contained in:
Markus F.X.J. Oberhumer
2006-08-20 11:15:36 +02:00
parent affb926d44
commit 996a99ad75
7 changed files with 224 additions and 211 deletions
-27
View File
@@ -78,33 +78,6 @@ const int *PackTos::getFilters() const
Linker* PackTos::newLinker() const
{
class ElfLinkerM68k : public ElfLinker
{
typedef ElfLinker super;
virtual void relocate1(Relocation *rel, upx_byte *location,
unsigned value, const char *type)
{
if (strncmp(type, "R_68K_", 6))
return super::relocate1(rel, location, value, type);
type += 6;
if (strncmp(type, "PC", 2) == 0)
{
value -= rel->section->offset + rel->offset;
type += 2;
}
if (strcmp(type, "8") == 0)
*location += value;
else if (strcmp(type, "16") == 0)
set_be16(location, get_be16(location) + value);
else if (strcmp(type, "32") == 0)
set_be32(location, get_be32(location) + value);
else
super::relocate1(rel, location, value, type);
}
};
return new ElfLinkerM68k;
}