1 // Copyright (c) 2008-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 // Classes for interpreting a memory area as an ELF or COFF object. |
|
15 // <creates> |
|
16 // Object_factory -----------------> Object |
|
17 // Elf_object Coff_object |
|
18 // |
|
19 // |
|
20 |
|
21 #ifndef OBJECT_H |
|
22 #define OBJECT_H |
|
23 |
|
24 #include <vector> |
|
25 #include <memory> |
|
26 |
|
27 |
|
28 class Object |
|
29 { |
|
30 public: |
|
31 virtual ~Object() = 0; |
|
32 public: |
|
33 // Does the object have an unresolved reference to the given symbol. |
|
34 virtual bool is_undef(const char*) const = 0; |
|
35 }; |
|
36 |
|
37 class Elf_object : public Object |
|
38 { |
|
39 public: |
|
40 Elf_object(const char*, const char*); |
|
41 virtual ~Elf_object(); |
|
42 public: |
|
43 virtual bool is_undef(const char*) const; |
|
44 private: |
|
45 std::vector<const char*> m_undef_symbols; |
|
46 }; |
|
47 |
|
48 class Coff_object : public Object |
|
49 { |
|
50 public: |
|
51 Coff_object(const char*, const char*); |
|
52 virtual ~Coff_object(); |
|
53 public: |
|
54 virtual bool is_undef(const char*) const; |
|
55 private: |
|
56 std::vector<const char*> m_undef_symbols; |
|
57 }; |
|
58 |
|
59 class Object_factory |
|
60 { |
|
61 public: |
|
62 enum objkind_t {ELF, COFF}; |
|
63 public: |
|
64 static std::auto_ptr<Object> create(objkind_t, const char*, const char*); |
|
65 }; |
|
66 |
|
67 |
|
68 #endif |
|
69 |
|