[PATCH] MIPS/BFD: Add a missing assertion in compound reloc handling

Maciej W. Rozycki macro@linux-mips.org
Mon May 7 03:46:00 GMT 2012


 I've noticed that unlike for RELA ones for REL n64 MIPS relocs we do not 
have an assertion to check the offset of the third reloc in a compound 
reloc at the time it's written out to the output file.  Is there anything 
I'm missing here?  OK to apply this change otherwise?  No regressions in 
mips64-linux-gnu testing.

2012-05-07  Maciej W. Rozycki  <macro@linux-mips.org>

	* elf64-mips.c (mips_elf64_be_swap_reloc_out): Also make sure
	the third reloc offset is the same as the first.


Index: binutils/bfd/elf64-mips.c
--- binutils.orig/bfd/elf64-mips.c
+++ binutils/bfd/elf64-mips.c
@@ -2708,6 +2708,7 @@ mips_elf64_be_swap_reloc_out (bfd *abfd,
   mirel.r_offset = src[0].r_offset;
   BFD_ASSERT(src[0].r_offset == src[1].r_offset);
+  BFD_ASSERT(src[0].r_offset == src[2].r_offset);
   mirel.r_type = ELF64_MIPS_R_TYPE (src[0].r_info);
   mirel.r_sym = ELF64_R_SYM (src[0].r_info);

More information about the Binutils mailing list