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]

[PATCH] Code cleanup in bfd/reloc.c


Hello All,

this does a bit of code cleanup.


Thiemo


2003-05-14  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/bfd/ChangeLog
	* reloc.c (bfd_install_relocation): Code cleanup.


diff -BurpNX /bigdisk/src/gcc-exclude source-orig/bfd/reloc.c source/bfd/reloc.c
--- source-orig/bfd/reloc.c	Fri Apr 25 07:35:26 2003
+++ source/bfd/reloc.c	Mon May  5 00:51:20 2003
@@ -987,7 +987,7 @@ bfd_install_relocation (abfd, reloc_entr
      char **error_message;
 {
   bfd_vma relocation;
-  bfd_reloc_status_type flag = bfd_reloc_ok;
+  bfd_reloc_status_type flag;
   bfd_size_type octets = reloc_entry->address * bfd_octets_per_byte (abfd);
   bfd_vma output_base = 0;
   reloc_howto_type *howto = reloc_entry->howto;
@@ -1007,17 +1007,15 @@ bfd_install_relocation (abfd, reloc_entr
      can be done.  */
   if (howto->special_function)
     {
-      bfd_reloc_status_type cont;
-
       /* XXX - The special_function calls haven't been fixed up to deal
 	 with creating new relocations and section contents.  */
-      cont = howto->special_function (abfd, reloc_entry, symbol,
+      flag = howto->special_function (abfd, reloc_entry, symbol,
 				      /* XXX - Non-portable! */
 				      ((bfd_byte *) data_start
 				       - data_start_offset),
 				      input_section, abfd, error_message);
-      if (cont != bfd_reloc_continue)
-	return cont;
+      if (flag != bfd_reloc_continue)
+	return flag;
     }
 
   /* Is the address of the relocation really within the section?  */
@@ -1094,7 +1096,7 @@ bfd_install_relocation (abfd, reloc_entr
 	 inplace to reflect what we now know.  */
       reloc_entry->addend = relocation;
       reloc_entry->address += input_section->output_offset;
-      return flag;
+      return bfd_reloc_ok;
     }
   else
     {
@@ -1202,6 +1204,8 @@ space consuming.  For each target:
 			       howto->rightshift,
 			       bfd_arch_bits_per_address (abfd),
 			       relocation);
+  else
+    flag = bfd_reloc_ok;
 
   /* Either we are relocating all the way, or we don't want to apply
      the relocation to the reloc entry (probably because there isn't


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