}
template <int valsize>
-void Insert_into_vector(std::vector<unsigned char>* destination,
+void insert_into_vector(std::vector<unsigned char>* destination,
typename elfcpp::Valtype_base<valsize>::Valtype value)
{
- union
- {
- unsigned char buffer[valsize / 8];
- long long align;
- } u;
+ unsigned char buffer[valsize / 8];
if (parameters->target().is_big_endian())
- elfcpp::Swap<valsize, true>::writeval(u.buffer, value);
+ elfcpp::Swap_unaligned<valsize, true>::writeval(buffer, value);
else
- elfcpp::Swap<valsize, false>::writeval(u.buffer, value);
- destination->insert(destination->end(), u.buffer, u.buffer + valsize / 8);
+ elfcpp::Swap_unaligned<valsize, false>::writeval(buffer, value);
+ destination->insert(destination->end(), buffer, buffer + valsize / 8);
}
template <int valsize>
return;
}
- Insert_into_vector<32>(&this->data_, 0xFFFFFFFF);
- Insert_into_vector<32>(&this->data_, 0);
- Insert_into_vector<64>(
+ insert_into_vector<32>(&this->data_, 0xFFFFFFFF);
+ insert_into_vector<32>(&this->data_, 0);
+ insert_into_vector<64>(
&this->data_,
(11 + get_length_as_unsigned_LEB_128(abbreviation_number)
+ die_end - debug_info));
- Insert_into_vector<16>(&this->data_, version);
- Insert_into_vector<64>(&this->data_, 0);
- Insert_into_vector<8>(&this->data_, address_size);
+ insert_into_vector<16>(&this->data_, version);
+ insert_into_vector<64>(&this->data_, 0);
+ insert_into_vector<8>(&this->data_, address_size);
write_unsigned_LEB_128(&this->data_, abbreviation_number);
this->data_.insert(this->data_.end(), debug_info, die_end);
}
return;
}
- Insert_into_vector<32>(
+ insert_into_vector<32>(
&this->data_,
(7 + get_length_as_unsigned_LEB_128(abbreviation_number)
+ die_end - debug_info));
- Insert_into_vector<16>(&this->data_, version);
- Insert_into_vector<32>(&this->data_, 0);
- Insert_into_vector<8>(&this->data_, address_size);
+ insert_into_vector<16>(&this->data_, version);
+ insert_into_vector<32>(&this->data_, 0);
+ insert_into_vector<8>(&this->data_, address_size);
write_unsigned_LEB_128(&this->data_, abbreviation_number);
this->data_.insert(this->data_.end(), debug_info, die_end);
}