Expose integral types in p_elf.h.
This commit is contained in:
+14
-1
@@ -37,9 +37,14 @@
|
|||||||
namespace N_Elf {
|
namespace N_Elf {
|
||||||
|
|
||||||
// The ELF file header. This appears at the start of every ELF file.
|
// The ELF file header. This appears at the start of every ELF file.
|
||||||
template <class Word, class Addr, class Off, class Half>
|
template <class TWord, class TAddr, class TOff, class THalf>
|
||||||
struct Ehdr
|
struct Ehdr
|
||||||
{
|
{
|
||||||
|
typedef TWord Word;
|
||||||
|
typedef TAddr Addr;
|
||||||
|
typedef TOff Off;
|
||||||
|
typedef THalf Half;
|
||||||
|
|
||||||
unsigned char e_ident[16]; /* Magic number and other info */
|
unsigned char e_ident[16]; /* Magic number and other info */
|
||||||
Half e_type; /* Object file type */
|
Half e_type; /* Object file type */
|
||||||
Half e_machine; /* Architecture */
|
Half e_machine; /* Architecture */
|
||||||
@@ -422,6 +427,14 @@ template <class TP, class TEhdr, class TPhdr, class TShdr, class TDyn, class TSy
|
|||||||
struct ElfClass
|
struct ElfClass
|
||||||
{
|
{
|
||||||
typedef TP BeLePolicy;
|
typedef TP BeLePolicy;
|
||||||
|
|
||||||
|
// integral types
|
||||||
|
typedef typename TP::U16 U16;
|
||||||
|
typedef typename TP::U32 U32;
|
||||||
|
typedef typename TP::U64 U64;
|
||||||
|
typedef typename TEhdr::Addr Addr;
|
||||||
|
|
||||||
|
// ELF types
|
||||||
typedef TEhdr Ehdr;
|
typedef TEhdr Ehdr;
|
||||||
typedef TPhdr Phdr;
|
typedef TPhdr Phdr;
|
||||||
typedef TShdr Shdr;
|
typedef TShdr Shdr;
|
||||||
|
|||||||
+8
-1
@@ -41,10 +41,17 @@ class PackVmlinuxBase : public Packer
|
|||||||
{
|
{
|
||||||
typedef Packer super;
|
typedef Packer super;
|
||||||
protected:
|
protected:
|
||||||
|
// integral types
|
||||||
|
typedef typename TElfClass::U16 U16;
|
||||||
|
typedef typename TElfClass::U32 U32;
|
||||||
|
typedef typename TElfClass::U64 U64;
|
||||||
|
typedef typename TElfClass::Addr Addr;
|
||||||
|
// ELF types
|
||||||
typedef typename TElfClass::Ehdr Ehdr;
|
typedef typename TElfClass::Ehdr Ehdr;
|
||||||
typedef typename TElfClass::Shdr Shdr;
|
typedef typename TElfClass::Shdr Shdr;
|
||||||
typedef typename TElfClass::Phdr Phdr;
|
typedef typename TElfClass::Phdr Phdr;
|
||||||
typedef /*typename TElfClass::Addr*/ unsigned long Addr;
|
typedef typename TElfClass::Dyn Dyn;
|
||||||
|
typedef typename TElfClass::Sym Sym;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PackVmlinuxBase(InputFile *f,
|
PackVmlinuxBase(InputFile *f,
|
||||||
|
|||||||
Reference in New Issue
Block a user