diff --git a/include/ehp.hpp b/include/ehp.hpp index d7072658a2da164bca4e795787cf1d02822f7cce..ba229e78b67764fb5574bbed4412d5aaf1bcd87e 100644 --- a/include/ehp.hpp +++ b/include/ehp.hpp @@ -169,7 +169,9 @@ class EHFrameParser_t virtual const CIEVector_t* getCIEs() const =0; virtual const FDEContents_t* findFDE(uint64_t addr) const =0; +#ifdef USE_ELFIO static unique_ptr<const EHFrameParser_t> factory(const string filename); +#endif static unique_ptr<const EHFrameParser_t> factory( uint8_t ptrsize, const string eh_frame_data, const uint64_t eh_frame_data_start_addr, diff --git a/src/ehp.cpp b/src/ehp.cpp index 13f26f3edb61443e0f0602668a48245140b476a8..6f4a40d5a12235690afdea3cdeb79b3db6f37e7a 100644 --- a/src/ehp.cpp +++ b/src/ehp.cpp @@ -29,12 +29,17 @@ #include "ehp_priv.hpp" #include "scoop_replacement.hpp" +#ifdef USE_ELFIO #include <elfio/elfio.hpp> +#endif #include <elf.h> using namespace std; using namespace EHP; + +#ifdef USE_ELFIO using namespace ELFIO; +#endif #define ALLOF(s) begin(s), end(s) @@ -1753,6 +1758,7 @@ const FDEContents_t* split_eh_frame_impl_t<ptrsize>::findFDE(uint64_t addr) cons return raw_ret_ptr; } +#ifdef USE_ELFIO unique_ptr<const EHFrameParser_t> EHFrameParser_t::factory(const string filename) { auto elfiop=unique_ptr<elfio>(new elfio); @@ -1789,6 +1795,7 @@ unique_ptr<const EHFrameParser_t> EHFrameParser_t::factory(const string filename gcc_except_table_section.first, gcc_except_table_section.second); } +#endif unique_ptr<const EHFrameParser_t> EHFrameParser_t::factory( uint8_t ptrsize,