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 Xtensa] Fix R_XTENSA_NONE relocation offsets


When the Xtensa version of gas removes a literal, it set the relocation type to R_XTENSA_NONE and modified the offset in a way that can leave the relocation offset out of range. This wouldn't matter, and is invisible everywhere but relocatable links, but is still incorrect.

Sterling

2009-04-01 Sterling Augustine <sterling@jaw.hq.tensilica.com>

	* elf32-xtensa.c (relax_property_section): Always set r_offset
	to zero.


Index: bfd/elf32-xtensa.c
===================================================================
--- bfd/elf32-xtensa.c	24 Feb 2009 22:51:10 -0000	1.113
+++ bfd/elf32-xtensa.c	1 Apr 2009 21:20:08 -0000
@@ -10015,12 +10015,7 @@ relax_property_section (bfd *abfd,
 	  if (remove_this_rel)
 	    {
 	      offset_rel->r_info = ELF32_R_INFO (0, R_XTENSA_NONE);
-	      /* In case this is the last entry, move the relocation offset
-		 to the previous entry, if there is one.  */
-	      if (offset_rel->r_offset >= bytes_to_remove)
-		offset_rel->r_offset -= bytes_to_remove;
-	      else
-		offset_rel->r_offset = 0;
+	      offset_rel->r_offset = 0;
 	    }
 
 	  if (bytes_to_remove != 0)

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