1 //===---- ObjectImage.h - Format independent executuable object image -----===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares a file format independent ObjectImage class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_RUNTIMEDYLD_OBJECT_IMAGE_H
15 #define LLVM_RUNTIMEDYLD_OBJECT_IMAGE_H
17 #include "llvm/Object/ObjectFile.h"
22 ObjectImage(); // = delete
23 ObjectImage(const ObjectImage &other); // = delete
25 object::ObjectFile *ObjFile;
28 ObjectImage(object::ObjectFile *Obj) { ObjFile = Obj; }
29 virtual ~ObjectImage() {}
31 virtual object::symbol_iterator begin_symbols() const
32 { return ObjFile->begin_symbols(); }
33 virtual object::symbol_iterator end_symbols() const
34 { return ObjFile->end_symbols(); }
36 virtual object::section_iterator begin_sections() const
37 { return ObjFile->begin_sections(); }
38 virtual object::section_iterator end_sections() const
39 { return ObjFile->end_sections(); }
41 virtual /* Triple::ArchType */ unsigned getArch() const
42 { return ObjFile->getArch(); }
44 // Subclasses can override these methods to update the image with loaded
45 // addresses for sections and common symbols
46 virtual void updateSectionAddress(const object::SectionRef &Sec,
48 virtual void updateSymbolAddress(const object::SymbolRef &Sym, uint64_t Addr)
51 // Subclasses can override these methods to provide JIT debugging support
52 virtual void registerWithDebugger() {}
53 virtual void deregisterWithDebugger() {}
56 } // end namespace llvm
58 #endif // LLVM_RUNTIMEDYLD_OBJECT_IMAGE_H