From 6a5ac672af716db1c5fe34e07f8b86381be16aee Mon Sep 17 00:00:00 2001 From: Antonio Flores Montoya <afloresmontoya@grammatech.com> Date: Mon, 29 Jul 2019 10:03:35 -0400 Subject: [PATCH] make the use of elfio optional --- include/ehp.hpp | 2 ++ src/ehp.cpp | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/include/ehp.hpp b/include/ehp.hpp index d707265..ba229e7 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 13f26f3..6f4a40d 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, -- GitLab