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] MIPS/BFD: Add a missing assertion in compound reloc handling


Hi,

 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>

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

  Maciej

binutils-mips64-reloc-assert.patch
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);


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