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