Lines 68-86
Link Here
|
68 |
} |
68 |
} |
69 |
|
69 |
|
70 |
template <int valsize> |
70 |
template <int valsize> |
71 |
void Insert_into_vector(std::vector<unsigned char>* destination, |
71 |
void insert_into_vector(std::vector<unsigned char>* destination, |
72 |
typename elfcpp::Valtype_base<valsize>::Valtype value) |
72 |
typename elfcpp::Valtype_base<valsize>::Valtype value) |
73 |
{ |
73 |
{ |
74 |
union |
74 |
unsigned char buffer[valsize / 8]; |
75 |
{ |
|
|
76 |
unsigned char buffer[valsize / 8]; |
77 |
long long align; |
78 |
} u; |
79 |
if (parameters->target().is_big_endian()) |
75 |
if (parameters->target().is_big_endian()) |
80 |
elfcpp::Swap<valsize, true>::writeval(u.buffer, value); |
76 |
elfcpp::Swap_unaligned<valsize, true>::writeval(buffer, value); |
81 |
else |
77 |
else |
82 |
elfcpp::Swap<valsize, false>::writeval(u.buffer, value); |
78 |
elfcpp::Swap_unaligned<valsize, false>::writeval(buffer, value); |
83 |
destination->insert(destination->end(), u.buffer, u.buffer + valsize / 8); |
79 |
destination->insert(destination->end(), buffer, buffer + valsize / 8); |
84 |
} |
80 |
} |
85 |
|
81 |
|
86 |
template <int valsize> |
82 |
template <int valsize> |
Lines 356-370
Link Here
|
356 |
return; |
352 |
return; |
357 |
} |
353 |
} |
358 |
|
354 |
|
359 |
Insert_into_vector<32>(&this->data_, 0xFFFFFFFF); |
355 |
insert_into_vector<32>(&this->data_, 0xFFFFFFFF); |
360 |
Insert_into_vector<32>(&this->data_, 0); |
356 |
insert_into_vector<32>(&this->data_, 0); |
361 |
Insert_into_vector<64>( |
357 |
insert_into_vector<64>( |
362 |
&this->data_, |
358 |
&this->data_, |
363 |
(11 + get_length_as_unsigned_LEB_128(abbreviation_number) |
359 |
(11 + get_length_as_unsigned_LEB_128(abbreviation_number) |
364 |
+ die_end - debug_info)); |
360 |
+ die_end - debug_info)); |
365 |
Insert_into_vector<16>(&this->data_, version); |
361 |
insert_into_vector<16>(&this->data_, version); |
366 |
Insert_into_vector<64>(&this->data_, 0); |
362 |
insert_into_vector<64>(&this->data_, 0); |
367 |
Insert_into_vector<8>(&this->data_, address_size); |
363 |
insert_into_vector<8>(&this->data_, address_size); |
368 |
write_unsigned_LEB_128(&this->data_, abbreviation_number); |
364 |
write_unsigned_LEB_128(&this->data_, abbreviation_number); |
369 |
this->data_.insert(this->data_.end(), debug_info, die_end); |
365 |
this->data_.insert(this->data_.end(), debug_info, die_end); |
370 |
} |
366 |
} |
Lines 398-410
Link Here
|
398 |
return; |
394 |
return; |
399 |
} |
395 |
} |
400 |
|
396 |
|
401 |
Insert_into_vector<32>( |
397 |
insert_into_vector<32>( |
402 |
&this->data_, |
398 |
&this->data_, |
403 |
(7 + get_length_as_unsigned_LEB_128(abbreviation_number) |
399 |
(7 + get_length_as_unsigned_LEB_128(abbreviation_number) |
404 |
+ die_end - debug_info)); |
400 |
+ die_end - debug_info)); |
405 |
Insert_into_vector<16>(&this->data_, version); |
401 |
insert_into_vector<16>(&this->data_, version); |
406 |
Insert_into_vector<32>(&this->data_, 0); |
402 |
insert_into_vector<32>(&this->data_, 0); |
407 |
Insert_into_vector<8>(&this->data_, address_size); |
403 |
insert_into_vector<8>(&this->data_, address_size); |
408 |
write_unsigned_LEB_128(&this->data_, abbreviation_number); |
404 |
write_unsigned_LEB_128(&this->data_, abbreviation_number); |
409 |
this->data_.insert(this->data_.end(), debug_info, die_end); |
405 |
this->data_.insert(this->data_.end(), debug_info, die_end); |
410 |
} |
406 |
} |