mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 09:58:19 +08:00
Issue a fatal error on bad fwrite return
* dwp.cc (Dwo_file::record_target_info): Issue a fatal error on bad fwrite return.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* dwp.cc (Dwo_file::record_target_info): Issue a fatal error
|
||||||
|
on bad fwrite return.
|
||||||
|
|
||||||
2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
|
2012-10-25 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
|
* dwp.cc (Dwo_file::remap_str_offset): Use section_offset_type
|
||||||
|
@ -1458,7 +1458,9 @@ Dwp_output_file::record_target_info(const char*, int machine,
|
|||||||
// Write zeroes for the ELF header initially. We'll write
|
// Write zeroes for the ELF header initially. We'll write
|
||||||
// the actual header during finalize().
|
// the actual header during finalize().
|
||||||
static const char buf[elfcpp::Elf_sizes<64>::ehdr_size] = { 0 };
|
static const char buf[elfcpp::Elf_sizes<64>::ehdr_size] = { 0 };
|
||||||
::fwrite(buf, 1, this->next_file_offset_, this->fd_);
|
if (::fwrite(buf, 1, this->next_file_offset_, this->fd_)
|
||||||
|
< (size_t) this->next_file_offset_)
|
||||||
|
gold_fatal(_("%s: %s"), this->name_, strerror(errno));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a string to the debug strings section.
|
// Add a string to the debug strings section.
|
||||||
|
Reference in New Issue
Block a user