bintools/elftools/inc/elftran.h
changeset 0 044383f39525
child 590 360bd6b35136
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 /*
       
     2 * Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Derived in part from E32IMAGE.H
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __ELFTRAN_H__
       
    21 #define __ELFTRAN_H__
       
    22 
       
    23 #include <e32std.h>
       
    24 #include <e32image.h>
       
    25 #include "e32ldfmt.h"
       
    26 #include <elfdefs.h>
       
    27 
       
    28 class ELFFile;
       
    29 
       
    30 //
       
    31 class E32ImageFile_ELF : public E32ImageFile
       
    32 	{
       
    33 public:
       
    34 	E32ImageFile_ELF();
       
    35 	virtual ~E32ImageFile_ELF();
       
    36 	virtual TBool Translate(const char* aFileName, TUint aDataBase, TBool aAllowDllData, \
       
    37 		TBool aSymLkupEnabled = FALSE);
       
    38 	TBool Translate(ELFFile& aElfFile);
       
    39 	TBool ImageIsDll(ELFFile& aElfFile);
       
    40 private:
       
    41 	TInt DoCodeHeader(ELFFile &aElfFile);
       
    42 	TInt DoDataHeader(ELFFile &aElfFile, TUint aDataBase);
       
    43 	TInt CopyCode(char *aPtr, ELFFile &aElfFile);
       
    44 	TInt CopyData(char *aPtr, ELFFile &aElfFile);
       
    45 
       
    46 	char *CreateImportSection(ELFFile &aElfFile, TInt &aSize);
       
    47 	void CreateExportSection(char *aPtr, ELFFile &aElfFile);
       
    48 
       
    49 	void FixRelocs(ELFFile &aElfFile, Elf32_Rel **codeRelocs, Elf32_Rel **dataRelocs);
       
    50 	char *CreateRelocs(ELFFile& aElfFile, Elf32_Rel **relocs, TInt nrelocs, TInt &aSize, TUint aBase);
       
    51 
       
    52 	TUint FixAddress(ELFFile &aElfFile, TUint va, Elf32_Rel * rel);
       
    53 
       
    54 	void SetUpExceptions(ELFFile &aElfFile);
       
    55 	void SetSymNameLookup(TInt aSymNameLkupEnabled);
       
    56 	TBool IsNamedLookupEnabled();
       
    57 	TBool SetUpLookupTable(ELFFile &aElfFile);
       
    58 	TInt DoSymbolLookupHeader(ELFFile &aElfFile, TInt aBaseOffset);
       
    59 	TUint CopyExportSymInfo(char *aPtr, ELFFile &aElfFile);
       
    60 	};
       
    61 
       
    62 #endif
       
    63 
       
    64 
       
    65