ELF/BFD: Propagate the return status from backend section processing

Fix the issue of any failure from `->elf_backend_section_processing'
not being propagated by `_bfd_elf_write_object_contents'.  The MIPS
`_bfd_mips_elf_section_processing' handler can actually potentially
fail, however the caller currently ignores that.

	bfd/
	* elf.c (_bfd_elf_write_object_contents): Propagate a failure
	status from `->elf_backend_section_processing'.
This commit is contained in:
Maciej W. Rozycki
2018-02-05 14:00:21 +00:00
parent 78c8836415
commit 7550610057
2 changed files with 7 additions and 1 deletions

View File

@@ -6354,7 +6354,8 @@ _bfd_elf_write_object_contents (bfd *abfd)
= _bfd_elf_strtab_offset (elf_shstrtab (abfd),
i_shdrp[count]->sh_name);
if (bed->elf_backend_section_processing)
(*bed->elf_backend_section_processing) (abfd, i_shdrp[count]);
if (!(*bed->elf_backend_section_processing) (abfd, i_shdrp[count]))
return FALSE;
if (i_shdrp[count]->contents)
{
bfd_size_type amt = i_shdrp[count]->sh_size;