bintools/elftools/inc/elffile.h
changeset 620 ad8ffc8e1982
parent 590 360bd6b35136
equal deleted inserted replaced
585:238f4cb8391f 620:ad8ffc8e1982
    18 
    18 
    19 #if !defined(__ELFFILE_H__)
    19 #if !defined(__ELFFILE_H__)
    20 #define __ELFFILE_H__
    20 #define __ELFFILE_H__
    21 #include <e32rom.h>
    21 #include <e32rom.h>
    22 #include "e32ldfmt.h"
    22 #include "e32ldfmt.h"
    23 #include <elfdefs.h>
    23 #include "elfdefs.h"
    24 
    24 
    25 #define ELFADDR(rtype, p, o) (rtype *)(((char *)p) + o)
    25 #define ELFADDR(rtype, p, o) (rtype *)(((char *)p) + o)
    26 
    26 
    27 //
    27 //
    28 enum TImportStat {EImpError, EImpSuccess, EImpDone};
    28 enum TImportStat {EImpError, EImpSuccess, EImpDone};
    30 class ELFFile
    30 class ELFFile
    31 	{
    31 	{
    32 public:
    32 public:
    33 	ELFFile();
    33 	ELFFile();
    34 	~ELFFile();
    34 	~ELFFile();
    35 	TBool Init(const TText * const aFileName);
    35 	TBool Init(const char* aFileName);
    36 	void Close(void);
    36 	void Close(void);
    37 
    37 
    38 	char *CreateImportSection(TInt &aSize);
    38 	char *CreateImportSection(TInt &aSize);
    39 
    39 
    40 	TBool GetRelocs(Elf32_Rel **aCodeRelocs, Elf32_Rel **aDataRelocs);
    40 	TBool GetRelocs(Elf32_Rel **aCodeRelocs, Elf32_Rel **aDataRelocs);
    82 	char * ELFFileBase() { return (char *) iElfFile; }
    82 	char * ELFFileBase() { return (char *) iElfFile; }
    83 
    83 
    84 	TUint GetExportTableOffset(void);
    84 	TUint GetExportTableOffset(void);
    85 	TUint GetEntryPointOffset(void) { return iElfFile->e_entry - iCodeSegmentHdr->p_vaddr; }
    85 	TUint GetEntryPointOffset(void) { return iElfFile->e_entry - iCodeSegmentHdr->p_vaddr; }
    86 
    86 
    87 	TBool SymbolPresent(TText *s);
    87 	TBool SymbolPresent(const char* s);
    88 	Elf32_Sym * FindSymbol(const TText *);
    88 	Elf32_Sym * FindSymbol(const char* s);
    89 
    89 
    90 	TBool GetExceptionIndexInfo(TUint32 &aOffset);
    90 	TBool GetExceptionIndexInfo(TUint32 &aOffset);
    91 	TBool SetUpLookupTable();
    91 	TBool SetUpLookupTable();
    92 	void SetLookupTblBase(TInt);
    92 	void SetLookupTblBase(TInt);
    93 	TInt GetLookupTblSize();
    93 	TInt GetLookupTblSize();
   120 	TUint iStackReservedSize;
   120 	TUint iStackReservedSize;
   121 private:
   121 private:
   122 	friend class E32ImageFile;
   122 	friend class E32ImageFile;
   123 	friend class E32ImageFile_ELF;
   123 	friend class E32ImageFile_ELF;
   124 
   124 
   125 	TText * iFileName;
   125 	char* iFileName;
   126 	TInt32 iFileHandle;
   126 	TInt32 iFileHandle;
   127 	Elf32_Ehdr * iElfFile;
   127 	Elf32_Ehdr * iElfFile;
   128 	Elf32_Phdr * iPhdr;
   128 	Elf32_Phdr * iPhdr;
   129 	Elf32_Phdr * iDynamicSegmentHdr;
   129 	Elf32_Phdr * iDynamicSegmentHdr;
   130 	TInt iDynamicSegmentIdx;
   130 	TInt iDynamicSegmentIdx;