From 9461ce11675f2018161919588b58c5bc295bb31c Mon Sep 17 00:00:00 2001
From: Serge Lamikhov-Center <to_serge@users.sourceforge.net>
Date: Fri, 2 Nov 2018 23:05:26 +0200
Subject: [PATCH] Fix "Call to virtual function during construction". Thanks to
 Pavel Kryukov

---
 elfio/elfio_header.hpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/elfio/elfio_header.hpp b/elfio/elfio_header.hpp
index e8713cd..6f8da02 100644
--- a/elfio/elfio_header.hpp
+++ b/elfio/elfio_header.hpp
@@ -86,6 +86,7 @@ template< class T > class elf_header_impl : public elf_header
         header.e_ident[EI_CLASS]   = elf_header_impl_types<T>::file_class;
         header.e_ident[EI_DATA]    = encoding;
         header.e_ident[EI_VERSION] = EV_CURRENT;
+        header.e_version           = (*convertor)( (Elf_Word)EV_CURRENT );
         header.e_ehsize            = ( sizeof( header ) );
         header.e_ehsize            = (*convertor)( header.e_ehsize );
         header.e_shstrndx          = (*convertor)( (Elf_Half)1 );
@@ -93,8 +94,6 @@ template< class T > class elf_header_impl : public elf_header
         header.e_shentsize         = sizeof( typename elf_header_impl_types<T>::Shdr_type );
         header.e_phentsize         = (*convertor)( header.e_phentsize );
         header.e_shentsize         = (*convertor)( header.e_shentsize );
-
-		set_version( EV_CURRENT );
     }
 
     bool