Skip to content

Commit

Permalink
Interfaces to byte-swap ElfData buffers between file and memory order.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrwilliams committed Oct 19, 2016
1 parent 1e658df commit 5cbda34
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions elf/src/Elf_X.C
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#include <sstream>
#include <libelf.h>


using namespace std;
using boost::crc_32_type;
using namespace boost::assign;
Expand Down Expand Up @@ -904,6 +905,24 @@ void Elf_X_Data::d_align(unsigned int input)
{
data->d_align = input;
}
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);
}
}

// Data Interface
const char *Elf_X_Data::get_string() const
Expand Down

0 comments on commit 5cbda34

Please sign in to comment.