diff --git a/src/linker.cpp b/src/linker.cpp index bbd841c9..9df8624b 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -561,6 +561,14 @@ void ElfLinkerArmLE::relocate1(const Relocation *rel, upx_byte *location, } +void ElfLinkerM68k::alignCode(unsigned len) +{ + assert((len & 1) == 0); + assert((outputlen & 1) == 0); + for (unsigned i = 0; i < len; i += 2) + set_be16(output + outputlen + i, 0x4e71); // "nop" +} + void ElfLinkerM68k::relocate1(const Relocation *rel, upx_byte *location, unsigned value, const char *type) { diff --git a/src/linker.h b/src/linker.h index 2599b630..44c113cd 100644 --- a/src/linker.h +++ b/src/linker.h @@ -171,6 +171,7 @@ class ElfLinkerM68k : public ElfLinker { typedef ElfLinker super; protected: + virtual void alignCode(unsigned len); virtual void relocate1(const Relocation *, upx_byte *location, unsigned value, const char *type); };