This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] _bfd_mips_elf_final_link: notify user about wrong .reginfo size


Signed-off-by: Vlad Ivanov <vlad@ivanov.email>
---
 bfd/elfxx-mips.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 6a4d3e1a6a..e27327c929 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -14431,7 +14431,13 @@ _bfd_mips_elf_final_link (bfd *abfd, struct bfd_link_info *info)
 	    }
 
 	  /* Size has been set in _bfd_mips_elf_always_size_sections.  */
-	  BFD_ASSERT(o->size == sizeof (Elf32_External_RegInfo));
+	  if (o->size != sizeof (Elf32_External_RegInfo)) {
+	    _bfd_error_handler
+	      (_("%B: .reginfo section size should be %d bytes, actual size is %d"),
+	       abfd, sizeof (Elf32_External_RegInfo), o->size);
+
+	    return FALSE;
+	  }
 
 	  /* Skip this section later on (I don't think this currently
 	     matters, but someday it might).  */
-- 
2.13.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]