ROSE  0.11.101.0
BinaryLoaderElfObj.h
1 #ifndef ROSE_BinaryAnalysis_BinaryLoaderElfObj_H
2 #define ROSE_BinaryAnalysis_BinaryLoaderElfObj_H
3 #include <featureTests.h>
4 #ifdef ROSE_ENABLE_BINARY_ANALYSIS
5 #include <Rose/BinaryAnalysis/BinaryLoaderElf.h>
6 
7 namespace Rose {
8 namespace BinaryAnalysis {
9 
15 public:
18 
19 protected:
21 
23  : BinaryLoaderElf(other)
24  {}
25 
26 public:
28  static Ptr instance() {
29  return Ptr(new BinaryLoaderElfObj);
30  }
31 
32  virtual ~BinaryLoaderElfObj() {}
33 
34  virtual BinaryLoaderPtr clone() const override {
35  return BinaryLoaderPtr(new BinaryLoaderElfObj(*this));
36  }
37 
38  virtual bool canLoad(SgAsmGenericHeader*) const override;
39 
40  // Same as super class but appends those sections that are not mapped but which contain code.
41  virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader*) override;
42 
43  // Same as super class but relaxes alignment constraints for sections that are ELF Sections but not ELF Segments.
45  rose_addr_t *malign_lo, rose_addr_t *malign_hi,
46  rose_addr_t *va, rose_addr_t *mem_size,
47  rose_addr_t *offset, rose_addr_t *file_size, bool *map_private,
48  rose_addr_t *va_offset, bool *anon_lo, bool *anon_hi,
49  ConflictResolution *resolve) override;
50 
51  // choose permissions based on the section content.
52  virtual unsigned mappingPermissions(SgAsmGenericSection*) const override;
53 };
54 
55 } // namespace
56 } // namespace
57 
58 #endif
59 #endif
Contiguous region of a file.
A loader suitable for ELF object files.
virtual bool canLoad(SgAsmGenericHeader *) const override
Capability query.
virtual BinaryLoaderPtr clone() const override
Copy constructor.
Main namespace for the ROSE library.
Reference-counting intrusive smart pointer.
Definition: SharedPointer.h:68
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) override
Linux-specific ELF Segment and Section alignment.
Binary analysis.
MappingContribution
Describes how a section contributes to the overall memory map.
Definition: BinaryLoader.h:63
virtual unsigned mappingPermissions(SgAsmGenericSection *) const override
MemoryMap permissions.
ConflictResolution
Describes how conflicts are resolved when mapping a section.
Definition: BinaryLoader.h:71
BinaryLoaderElfObjPtr Ptr
Reference counting pointer to BinaryLoaderElfObj.
virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader *) override
Returns mappable sections in a particular order.
static Ptr instance()
Allocating constructor.