diff --git a/elfcpp/elfcpp_swap.h b/elfcpp/elfcpp_swap.h index 5b9a915..cddc0b3 100644 --- a/elfcpp/elfcpp_swap.h +++ b/elfcpp/elfcpp_swap.h @@ -234,7 +234,10 @@ struct Swap static inline void writeval(Valtype* wv, Valtype v) - { *wv = Convert::convert_host(v); } + { + Valtype T = Convert::convert_host(v); + memcpy(wv, &T, sizeof(T)); + } static inline Valtype readval(const unsigned char* wv)