ROSE  0.11.2.0
BinaryLoaderElfObj.h
1 #ifndef ROSE_BinaryAnalysis_BinaryLoaderElfObj_H
2 #define ROSE_BinaryAnalysis_BinaryLoaderElfObj_H
3 
4 #include "BinaryLoaderElf.h"
5 #ifdef ROSE_BUILD_BINARY_ANALYSIS_SUPPORT
6 
7 namespace Rose {
8 namespace BinaryAnalysis {
9 
12 
18 public:
21 
22 protected:
24 
26  : BinaryLoaderElf(other)
27  {}
28 
29 public:
31  static Ptr instance() {
32  return Ptr(new BinaryLoaderElfObj);
33  }
34 
35  virtual ~BinaryLoaderElfObj() {}
36 
37  virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE {
38  return BinaryLoaderPtr(new BinaryLoaderElfObj(*this));
39  }
40 
41  virtual bool canLoad(SgAsmGenericHeader*) const ROSE_OVERRIDE;
42 
43  // Same as super class but appends those sections that are not mapped but which contain code.
44  virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader*) ROSE_OVERRIDE;
45 
46  // Same as super class but relaxes alignment constraints for sections that are ELF Sections but not ELF Segments.
48  rose_addr_t *malign_lo, rose_addr_t *malign_hi,
49  rose_addr_t *va, rose_addr_t *mem_size,
50  rose_addr_t *offset, rose_addr_t *file_size, bool *map_private,
51  rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi,
52  ConflictResolution *resolve) ROSE_OVERRIDE;
53 
54  // choose permissions based on the section content.
55  virtual unsigned mappingPermissions(SgAsmGenericSection*) const ROSE_OVERRIDE;
56 };
57 
58 } // namespace
59 } // namespace
60 
61 #endif
62 #endif
Contiguous region of a file.
A loader suitable for ELF object files.
virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader *) ROSE_OVERRIDE
Returns mappable sections in a particular order.
Main namespace for the ROSE library.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
virtual bool canLoad(SgAsmGenericHeader *) const ROSE_OVERRIDE
Capability query.
virtual BinaryLoaderPtr clone() const ROSE_OVERRIDE
Copy constructor.
Base class for container file headers.
virtual MappingContribution alignValues(SgAsmGenericSection *, const MemoryMap::Ptr &, rose_addr_t *malign_lo, rose_addr_t *malign_hi, rose_addr_t *va, rose_addr_t *mem_size, rose_addr_t *offset, rose_addr_t *file_size, bool *map_private, rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi, ConflictResolution *resolve) ROSE_OVERRIDE
Linux-specific ELF Segment and Section alignment.
An efficient mapping from an address space to stored data.
Definition: MemoryMap.h:112
Sawyer::SharedPointer< class BinaryLoader > BinaryLoaderPtr
Reference counting pointer to BinaryLoader.
Definition: BinaryLoader.h:16
MappingContribution
Describes how a section contributes to the overall memory map.
Definition: BinaryLoader.h:66
ConflictResolution
Describes how conflicts are resolved when mapping a section.
Definition: BinaryLoader.h:74
Sawyer::SharedPointer< class BinaryLoaderElfObj > Ptr
Reference counting pointer to BinaryLoaderElfObj.
virtual unsigned mappingPermissions(SgAsmGenericSection *) const ROSE_OVERRIDE
MemoryMap permissions.
static Ptr instance()
Allocating constructor.
Sawyer::SharedPointer< class BinaryLoaderElfObj > BinaryLoaderElfObjPtr
Reference counting pointer to BinaryLoaderElfObj.