This is the mail archive of the binutils@sources.redhat.com 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]

[committed] small cleanup in elfxx-mips.c


Found this as I was cleaning up some other code. There's no functional
change. Tested on mips-elf and committed.

2005-04-04  Eric Christopher  <echristo@redhat.com>

	* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents):
	Clean up gp handling code.

Index: elfxx-mips.c
===================================================================
RCS file: /cvs/src/src/bfd/elfxx-mips.c,v
retrieving revision 1.129
diff -u -p -w -r1.129 elfxx-mips.c
--- elfxx-mips.c	24 Mar 2005 22:47:51 -0000	1.129
+++ elfxx-mips.c	5 Apr 2005 06:51:09 -0000
@@ -8754,30 +8754,21 @@ _bfd_elf_mips_get_relocated_section_cont
 	  /* Specific to MIPS: Deal with relocation types that require
 	     knowing the gp of the output bfd.  */
 	  asymbol *sym = *(*parent)->sym_ptr_ptr;
-	  if (bfd_is_abs_section (sym->section) && abfd)
-	    {
-	      /* The special_function wouldn't get called anyway.  */
-	    }
-	  else if (!gp_found)
-	    {
-	      /* The gp isn't there; let the special function code
-		 fall over on its own.  */
-	    }
-	  else if ((*parent)->howto->special_function
+
+	  /* If we've managed to find the gp and have a special
+	     function for the relocation then go ahead, else default
+	     to the generic handling.  */
+	  if (gp_found
+	      && (*parent)->howto->special_function
 		   == _bfd_mips_elf32_gprel16_reloc)
-	    {
-	      /* bypass special_function call */
 	      r = _bfd_mips_elf_gprel16_with_gp (input_bfd, sym, *parent,
 						 input_section, relocatable,
 						 data, gp);
-	      goto skip_bfd_perform_relocation;
-	    }
-	  /* end mips specific stuff */
-
-	  r = bfd_perform_relocation (input_bfd, *parent, data, input_section,
+	  else
+	    r = bfd_perform_relocation (input_bfd, *parent, data, 
+					input_section,
 				      relocatable ? abfd : NULL,
 				      &error_message);
-	skip_bfd_perform_relocation:
 
 	  if (relocatable)
 	    {



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