Introduce target endianness accessors get_teXX() and set_teXX() in packer.h to

replace all [gs]et_nativeXX() member functions.
This commit is contained in:
Markus F.X.J. Oberhumer
2008-01-09 13:57:47 +01:00
parent 9060ac7897
commit 7f9c47176a
12 changed files with 328 additions and 363 deletions
+9 -1
View File
@@ -38,7 +38,7 @@ class ElfLinker : private noncopyable
{
friend class Packer;
public:
const N_BELE_RTP::AbstractPolicy *bele;
const N_BELE_RTP::AbstractPolicy *bele; // target endianness
protected:
struct Section;
struct Symbol;
@@ -107,6 +107,14 @@ protected:
virtual void relocate();
virtual void relocate1(const Relocation *, upx_byte *location,
unsigned value, const char *type);
// target endianness abstraction
unsigned get_te16(const void *p) const { return bele->get16(p); }
unsigned get_te32(const void *p) const { return bele->get32(p); }
acc_uint64l_t get_te64(const void *p) const { return bele->get64(p); }
void set_te16(void *p, unsigned v) const { bele->set16(p, v); }
void set_te32(void *p, unsigned v) const { bele->set32(p, v); }
void set_te64(void *p, acc_uint64l_t v) const { bele->set64(p, v); }
};