ROSE 0.11.145.192
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
7namespace Rose {
8namespace BinaryAnalysis {
9
15public:
18
19protected:
21
23 : BinaryLoaderElf(other)
24 {}
25
26public:
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
A loader suitable for ELF object files.
static Ptr instance()
Allocating constructor.
virtual BinaryLoaderPtr clone() const override
Copy constructor.
virtual bool canLoad(SgAsmGenericHeader *) const override
Capability query.
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.
virtual unsigned mappingPermissions(SgAsmGenericSection *) const override
MemoryMap permissions.
BinaryLoaderElfObjPtr Ptr
Reference counting pointer to BinaryLoaderElfObj.
virtual SgAsmGenericSectionPtrList getRemapSections(SgAsmGenericHeader *) override
Returns mappable sections in a particular order.
MappingContribution
Describes how a section contributes to the overall memory map.
ConflictResolution
Describes how conflicts are resolved when mapping a section.
Reference-counting intrusive smart pointer.
Base class for container file headers.
Contiguous region of a file.
Sawyer::SharedPointer< BinaryLoaderElfObj > BinaryLoaderElfObjPtr
Reference counting pointer.
Sawyer::SharedPointer< BinaryLoader > BinaryLoaderPtr
Reference counting pointer.
The ROSE library.