Skip to content

Commit

Permalink
Merge pull request #192 from dyninst/elfx_add_xlate_funcs
Browse files Browse the repository at this point in the history
ElfX: add xlate funcs
  • Loading branch information
wrwilliams committed Oct 12, 2016
2 parents af9459a + a3b08c7 commit 77084d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions elf/h/Elf_X.h
Expand Up @@ -259,6 +259,8 @@ class DYNELF_EXPORT Elf_X_Data {
size_t d_size() const;
off_t d_off() const;
size_t d_align() const;
void xlatetom(unsigned int encode);
void xlatetof(unsigned int encode);

// Write Interface
void d_buf(void *input);
Expand Down
19 changes: 19 additions & 0 deletions elf/src/Elf_X.C
Expand Up @@ -45,6 +45,7 @@
#include <iostream>
#include <iomanip>
#include <sstream>
#include <libelf.h>

using namespace std;
using boost::crc_32_type;
Expand Down Expand Up @@ -854,6 +855,24 @@ size_t Elf_X_Data::d_align() const
{
return data->d_align;
}
void Elf_X_Data::xlatetom(unsigned int encode)
{
if(is64)
{
elf64_xlatetom(data, data, encode);
} else {
elf32_xlatetom(data, data, encode);
}
}
void Elf_X_Data::xlatetof(unsigned int encode)
{
if(is64)
{
elf64_xlatetof(data, data, encode);
} else {
elf32_xlatetof(data, data, encode);
}
}

// Write Interface
void Elf_X_Data::d_buf(void *input)
Expand Down

0 comments on commit 77084d1

Please sign in to comment.