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 ElfExports for the elf2e32 tool |
|
15 // @internalComponent |
|
16 // @released |
|
17 // |
|
18 // |
|
19 |
|
20 #if !defined(_PL_ELFEXPORTS_H_) |
|
21 #define _PL_ELFEXPORTS_H_ |
|
22 |
|
23 #include "pl_common.h" |
|
24 #include <vector> |
|
25 #include <functional> |
|
26 #include <algorithm> |
|
27 |
|
28 using std::vector; |
|
29 using std::binary_function; |
|
30 |
|
31 class ElfExecutable; |
|
32 class DllSymbol; |
|
33 class Symbol; |
|
34 |
|
35 /** |
|
36 This class is for exports coming from elf file. |
|
37 (Corresponding to the exported symbols defined in the given DLL. These exports are filtered |
|
38 by individual targets as per their requirements(relating to class impedimenta). While |
|
39 processing these exports, they are also to update the ordinal numbers before these exports |
|
40 are written into the dso file. |
|
41 @internalComponent |
|
42 @released |
|
43 */ |
|
44 class ElfExports |
|
45 { |
|
46 |
|
47 public: |
|
48 typedef std::vector<DllSymbol*> ExportList; |
|
49 |
|
50 |
|
51 struct PtrELFExportNameCompare : |
|
52 binary_function<const Symbol *, const Symbol *, bool> |
|
53 { |
|
54 bool operator()(const Symbol * lhs, const Symbol * rhs) const; |
|
55 }; |
|
56 |
|
57 struct PtrELFExportOrdinalCompare : |
|
58 binary_function<const Symbol *, const Symbol *, bool> |
|
59 { |
|
60 bool operator()(const Symbol * lhs, const Symbol * rhs) const; |
|
61 }; |
|
62 |
|
63 struct PtrELFExportNameCompareUpdateAttributes : |
|
64 binary_function<const Symbol *, const Symbol *, bool> |
|
65 { |
|
66 bool operator()(const Symbol * lhs, const Symbol * rhs) const; |
|
67 }; |
|
68 |
|
69 |
|
70 ElfExports(); |
|
71 ~ElfExports(); |
|
72 |
|
73 bool ValidExportP(ElfExecutable * aExecutable, DllSymbol * aSym); |
|
74 void FilterExports(); |
|
75 DllSymbol* Add(char *aDll, ElfExecutable * aExecutable, DllSymbol *aSym); |
|
76 void Add(char *aDll, DllSymbol *aSym); |
|
77 void Sort(); |
|
78 void ExportsFilteredP(bool aExportsFilteredP) |
|
79 { |
|
80 iExportsFilteredP = aExportsFilteredP; |
|
81 } |
|
82 bool ExportsFilteredP() {return iExportsFilteredP;} |
|
83 |
|
84 char* DllName(); |
|
85 ExportList& GetExports(bool) ; |
|
86 ExportList& GetExportsInOrdinalOrder(); |
|
87 size_t GetNumExports(); |
|
88 ExportList iFilteredExports; |
|
89 |
|
90 private: |
|
91 ExportList iExportList; |
|
92 char *iDllName; |
|
93 bool iSorted; |
|
94 bool iExportsFilteredP; |
|
95 }; |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 #endif // !defined(_PL_ELFEXPORTS_H_) |
|