OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // This file contains the interface for processing ELF Data | |
6 | |
7 #ifndef ELF_READER_ELF_READER_H_ | |
8 #define ELF_READER_ELF_READER_H_ | |
9 | |
10 #include "common/types.h" | |
11 | |
12 namespace elf_reader { | |
13 | |
14 // Pure interface class for an ElfReader. | |
15 class IElfReader { | |
16 public: | |
17 // Called at the beginning of processing, with basic information | |
18 // about the ELF file being processed. | |
19 virtual void Init(const char *path, | |
20 void *data, | |
21 uint64_t length, | |
22 uint32_t classSize, | |
23 bool lsb) = 0; | |
24 | |
25 // These functions are called when processing sections headers. The | |
26 // SectionHeaderStart function must return true for this data to | |
27 // be processed. | |
28 virtual bool SectionHeadersStart(uint32_t count) = 0; | |
29 virtual void SectionHeadersEnd() = 0; | |
30 virtual void AddSectionHeader(const char *name, | |
31 void *data, | |
32 uint64_t virt, | |
33 uint32_t type, | |
34 uint32_t flags, | |
35 uint64_t size) = 0; | |
36 }; | |
37 | |
38 } // namespace elf_reader | |
39 | |
40 #endif // ELF_READER_ELF_READER_H_ | |
41 | |
OLD | NEW |