tidy elf32-ppc.c

Alan Modra amodra@gmail.com
Mon Jul 5 13:34:00 GMT 2010


Cosmetic fixes.

	* elf32-ppc.c: Formatting.
	(ppc_elf_finish_dynamic_sections): Don't make plt_entry var static.

Index: bfd/elf32-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
retrieving revision 1.283
diff -u -p -r1.283 elf32-ppc.c
--- bfd/elf32-ppc.c	27 Jun 2010 04:07:51 -0000	1.283
+++ bfd/elf32-ppc.c	5 Jul 2010 13:28:40 -0000
@@ -2192,7 +2192,7 @@ ppc_elf_begin_write_processing (bfd *abf
 	  if (!buffer)
 	    return;
 	}
-      
+
       if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0
 	  || (bfd_bread (buffer, length, ibfd) != length))
 	{
@@ -2230,7 +2230,7 @@ ppc_elf_begin_write_processing (bfd *abf
     {
       /* Compute the size of the output section.  */
       unsigned num_entries = apuinfo_list_length ();
-      
+
       /* Set the output section size, if it exists.  */
       asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME);
 
@@ -2708,7 +2708,7 @@ struct ppc_elf_link_hash_table
 
   /* The bfd that forced an old-style PLT.  */
   bfd *old_bfd;
- 
+
   /* TLS local dynamic got entry handling.  */
   union {
     bfd_signed_vma refcount;
@@ -4044,15 +4044,15 @@ ppc_elf_merge_obj_attributes (bfd *ibfd,
 	  (_("Warning: %B uses hard float, %B uses soft float"), obfd, ibfd);
       else if (out_attr->i == 1 && in_attr->i == 3)
 	_bfd_error_handler
-	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"), 
+	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
 	  obfd, ibfd);
       else if (out_attr->i == 3 && in_attr->i == 1)
 	_bfd_error_handler
-	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"), 
+	  (_("Warning: %B uses double-precision hard float, %B uses single-precision hard float"),
 	  ibfd, obfd);
       else if (out_attr->i == 3 && in_attr->i == 2)
 	_bfd_error_handler
-	  (_("Warning: %B uses soft float, %B uses single-precision hard float"), 
+	  (_("Warning: %B uses soft float, %B uses single-precision hard float"),
 	  ibfd, obfd);
       else if (out_attr->i == 2 && (in_attr->i == 1 || in_attr->i == 3))
 	_bfd_error_handler
@@ -5227,7 +5227,7 @@ allocate_dynrelocs (struct elf_link_hash
 
 			/* If this symbol is not defined in a regular
 			   file, and we are not generating a shared
-			   library, then set the symbol to this location 
+			   library, then set the symbol to this location
 			   in the .plt.  This is to avoid text
 			   relocations, and is required to make
 			   function pointers compare as equal between
@@ -5983,7 +5983,7 @@ ppc_elf_relax_section (bfd *abfd,
      anyway.  */
   if (link_info->relocatable && link_info->shared)
      return TRUE;
-  
+
   trampoff = (isec->size + 3) & (bfd_vma) -4;
   /* Space for a branch around any trampolines.  */
   trampoff += 4;
@@ -6388,7 +6388,7 @@ ppc_elf_relax_section (bfd *abfd,
       Elf_Internal_Rela *new_relocs = bfd_malloc ((changes + isec->reloc_count)
 						  * sizeof (*new_relocs));
       unsigned ix;
-      
+
       if (!new_relocs)
 	goto error_return;
       memcpy (new_relocs, internal_relocs,
@@ -6430,7 +6430,7 @@ ppc_elf_relax_section (bfd *abfd,
 	    irel++;
 	  }
     }
-  
+
   return TRUE;
 
  error_return:
@@ -7600,9 +7600,9 @@ ppc_elf_relocate_section (bfd *output_bf
 		}
 
 	      skip = 0;
-	      outrel.r_offset =
-		_bfd_elf_section_offset (output_bfd, info, input_section,
-					 rel->r_offset);
+	      outrel.r_offset = _bfd_elf_section_offset (output_bfd, info,
+							 input_section,
+							 rel->r_offset);
 	      if (outrel.r_offset == (bfd_vma) -1
 		  || outrel.r_offset == (bfd_vma) -2)
 		skip = (int) outrel.r_offset;
@@ -8197,7 +8197,7 @@ ppc_elf_finish_dynamic_symbol (bfd *outp
 	      {
 		bfd_vma got_offset;
 		const bfd_vma *plt_entry;
-		
+
 		/* The first three entries in .got.plt are reserved.  */
 		got_offset = (reloc_index + 3) * 4;
 
@@ -8238,7 +8238,7 @@ ppc_elf_finish_dynamic_symbol (bfd *outp
 		   low-order 16 bits of the load instruction.  */
 		/* NOTE: It appears that this is now an index rather than a
 		   prescaled offset.  */
-		bfd_put_32 (output_bfd, 
+		bfd_put_32 (output_bfd,
 			    plt_entry[4] | reloc_index,
 			    htab->plt->contents + ent->plt.offset + 16);
 		/* This instruction is a PC-relative branch whose target is
@@ -8247,8 +8247,8 @@ ppc_elf_finish_dynamic_symbol (bfd *outp
 		   The address is encoded in bits 6-29, inclusive.  The value
 		   stored is right-shifted by two bits, permitting a 26-bit
 		   offset.  */
-		bfd_put_32 (output_bfd, 
-			    (plt_entry[5] 
+		bfd_put_32 (output_bfd,
+			    (plt_entry[5]
 			     | (-(ent->plt.offset + 20) & 0x03fffffc)),
 			    htab->plt->contents + ent->plt.offset + 20);
 		bfd_put_32 (output_bfd, plt_entry[6],
@@ -8397,8 +8397,8 @@ ppc_elf_finish_dynamic_symbol (bfd *outp
 		   relocation.  */
 		sym->st_shndx = (_bfd_elf_section_from_bfd_section
 				 (output_bfd, htab->glink->output_section));
-		sym->st_value = (ent->glink_offset +
-				 htab->glink->output_offset
+		sym->st_value = (ent->glink_offset
+				 + htab->glink->output_offset
 				 + htab->glink->output_section->vma);
 	      }
 	    doneone = TRUE;
@@ -8527,7 +8527,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou
   dynobj = elf_hash_table (info)->dynobj;
   sdyn = bfd_get_section_by_name (dynobj, ".dynamic");
   if (htab->is_vxworks)
-    splt = bfd_get_section_by_name (dynobj, ".plt");  
+    splt = bfd_get_section_by_name (dynobj, ".plt");
   else
     splt = NULL;
 
@@ -8636,9 +8636,9 @@ ppc_elf_finish_dynamic_sections (bfd *ou
   if (splt && splt->size > 0)
     {
       /* Use the right PLT. */
-      static const bfd_vma *plt_entry = NULL;
-      plt_entry = info->shared ? 
-	ppc_elf_vxworks_pic_plt0_entry : ppc_elf_vxworks_plt0_entry;
+      const bfd_vma *plt_entry = (info->shared
+				  ? ppc_elf_vxworks_pic_plt0_entry
+				  : ppc_elf_vxworks_plt0_entry);
 
       if (!info->shared)
 	{
@@ -8676,7 +8676,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou
 	  rela.r_addend = 0;
 	  bfd_elf32_swap_reloca_out (output_bfd, &rela, loc);
 	  loc += sizeof (Elf32_External_Rela);
-	  
+
 	  /* Output the @l relocation for the second instruction.  */
 	  rela.r_offset = (htab->plt->output_section->vma
 			   + htab->plt->output_offset

-- 
Alan Modra
Australia Development Lab, IBM



More information about the Binutils mailing list