1 // Copyright (c) 2004-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 // Implementation of the Class DSOHandler for the elf2e32 tool |
|
15 // @internalComponent |
|
16 // @released |
|
17 // |
|
18 // |
|
19 |
|
20 |
|
21 #include "pl_dso_handler.h" |
|
22 #include "pl_elfconsumer.h" |
|
23 #include "pl_elfproducer.h" |
|
24 |
|
25 /** |
|
26 Constructor for class DSOHandler |
|
27 @param aParameterListInterface - instance of ParameterListInterface |
|
28 @internalComponent |
|
29 @released |
|
30 */ |
|
31 DSOHandler::DSOHandler( ParameterListInterface *aParameterListInterface){ |
|
32 |
|
33 iParameterListInterface = aParameterListInterface; |
|
34 iElfProducer = new ElfProducer(iParameterListInterface); |
|
35 iElfConsumer = new ElfConsumer(iParameterListInterface); |
|
36 } |
|
37 |
|
38 |
|
39 |
|
40 /** |
|
41 Destructor for class DSOHandler to release allocated memory |
|
42 @internalComponent |
|
43 @released |
|
44 */ |
|
45 DSOHandler::~DSOHandler(){ |
|
46 |
|
47 DELETE_PTR(iElfProducer); |
|
48 DELETE_PTR(iElfConsumer); |
|
49 } |
|
50 |
|
51 |
|
52 /** |
|
53 Reads the ELF executable file through its ElfConsumer member |
|
54 @param aElfFile The ELF executable file name |
|
55 @internalComponent |
|
56 @released |
|
57 @return Error status |
|
58 */ |
|
59 PLUINT32 DSOHandler::ReadElfFile(char* aElfFile){ |
|
60 return iElfConsumer->ReadElfFile( aElfFile ); |
|
61 } |
|
62 |
|
63 /** |
|
64 Processes the ELF executable file through its ElfConsumer member |
|
65 @internalComponent |
|
66 @released |
|
67 @return Error status |
|
68 */ |
|
69 void DSOHandler::ProcessElfFile(){ |
|
70 iElfConsumer->ProcessElfFile(); |
|
71 } |
|
72 |
|
73 /** |
|
74 Writes the proxy DSO file through its ElfProducer member |
|
75 @internalComponent |
|
76 @released |
|
77 @return Error Status |
|
78 @param aDsoFullName The full path and the proxy DSO library file name |
|
79 @param aDSOName The proxy DSO library file name |
|
80 @param aDllName The DLL name that defines the exported symbols. |
|
81 @param aSymbolList The list of exported Symbols that are to be included within the proxy DSO library. |
|
82 */ |
|
83 PLUINT32 DSOHandler::WriteElfFile(char* aDsoFullName, char* aDSOName, char* aDllName, SymbolList& aSymbolList){ |
|
84 |
|
85 iElfProducer->SetSymbolList( aSymbolList ); |
|
86 iElfProducer->WriteElfFile(aDsoFullName, aDSOName, aDllName); |
|
87 |
|
88 return 0; |
|
89 } |
|
90 |
|
91 |
|
92 /** |
|
93 This operation fetches the list of symbols that are exported from the ELF |
|
94 file. This list is used by UseCaseHandler to finalise the export symbols and |
|
95 compare them with those found from the DEF file. |
|
96 @internalComponent |
|
97 @released |
|
98 @return Error status |
|
99 @param aList A reference to the list is passed so as to fetch all the exported Symbols from ELF executable. |
|
100 */ |
|
101 int DSOHandler::GetElfExportSymbolList(SymbolList& aList){ |
|
102 return (iElfConsumer->GetElfSymbolList(aList)); |
|
103 } |
|
104 |
|
105 |
|
106 /** |
|
107 |
|
108 @internalComponent |
|
109 @released |
|
110 @param |
|
111 */ |
|
112 void DSOHandler::GetImageDetails(/*E32ImageInterface aImageInterface*/){ |
|
113 |
|
114 } |
|
115 |
|
116 /** |
|
117 Function for retuning instance of elf consumer |
|
118 @internalComponent |
|
119 @released |
|
120 @return return the elf consumer instance |
|
121 */ |
|
122 ElfExecutable * DSOHandler::ElfExecutableP(){ |
|
123 return iElfConsumer; |
|
124 } |
|
125 |
|
126 |
|