This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/3] ELF/BFD: Propagate the return status from backend section processing
- From: "Maciej W. Rozycki" <macro at mips dot com>
- To: <binutils at sourceware dot org>
- Date: Fri, 2 Feb 2018 17:23:20 +0000
- Subject: [PATCH 2/3] ELF/BFD: Propagate the return status from backend section processing
- Authentication-results: sourceware.org; auth=none
- References: <alpine.DEB.2.00.1802011856140.4191@tp.orcam.me.uk>
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'.
---
Hi,
I think this qualifies as obvious really. No regressions across my usual
targets (only the MIPS handler containss code that allows it to fail
anyway). OK to apply?
Maciej
---
bfd/elf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
binutils-bfd-elf-backend-section-processing-error.diff
Index: binutils/bfd/elf.c
===================================================================
--- binutils.orig/bfd/elf.c 2018-01-30 18:07:24.110281697 +0000
+++ binutils/bfd/elf.c 2018-02-01 01:34:41.603581368 +0000
@@ -6354,7 +6354,8 @@ _bfd_elf_write_object_contents (bfd *abf
= _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;