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]

Re: Your checkin broke elf32-arm.c, at least with -Werror for gcc-4.1.2


On Tue, Feb 24, 2009 at 12:22:24AM +0100, Hans-Peter Nilsson wrote:
> Your latest checkin caused a warning when compiled with
> gcc-4.1.2 (F 8 on x86_64), but bfd is compiled with -Werror, as
> observed by my autotester building arm-sim:

Both problems are actually my fault; I checked in the patch for
Christophe.  I've checked this in to fix them.

-- 
Daniel Jacobowitz
CodeSourcery

2009-02-23  Daniel Jacobowitz  <dan@codesourcery.com>

	* elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
	Fix formatting.
	(arm_size_one_stub): Remove unnecessary break.
	(arm_map_one_stub): Fix formatting.  Return after BFD_FAIL.

Index: bfd/elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.174
diff -u -p -r1.174 elf32-arm.c
--- bfd/elf32-arm.c	23 Feb 2009 21:48:53 -0000	1.174
+++ bfd/elf32-arm.c	24 Feb 2009 00:20:56 -0000
@@ -3151,7 +3151,7 @@ arm_build_one_stub (struct bfd_hash_entr
   int i;
   struct elf32_arm_link_hash_table * globals;
   int stub_reloc_idx = -1;
-  int stub_reloc_offset;
+  int stub_reloc_offset = 0;
 
   /* Massage our args to the form they really have.  */
   stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
@@ -3183,7 +3183,7 @@ arm_build_one_stub (struct bfd_hash_entr
   size = 0;
   for (i = 0; i < template_size; i++)
     {
-      switch(template[i].type)
+      switch (template[i].type)
 	{
 	case THUMB16_TYPE:
 	  put_thumb_insn (globals, stub_bfd, template[i].data, loc + size);
@@ -3284,13 +3284,12 @@ arm_size_one_stub (struct bfd_hash_entry
     default:
       BFD_FAIL ();
       return FALSE;
-      break;
     }
 
   size = 0;
   for (i = 0; i < template_size; i++)
     {
-      switch(template[i].type)
+      switch (template[i].type)
 	{
 	case THUMB16_TYPE:
 	  size += 2;
@@ -11716,7 +11715,7 @@ arm_map_one_stub (struct bfd_hash_entry 
   stub_name = stub_entry->output_name;
 
   template = stub_entry->stub_template;
-  switch(template[0].type)
+  switch (template[0].type)
     {
     case ARM_TYPE:
       if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size))
@@ -11729,13 +11728,14 @@ arm_map_one_stub (struct bfd_hash_entry 
       break;
     default:
       BFD_FAIL ();
+      return FALSE;
     }
 
   prev_type = DATA_TYPE;
   size = 0;
   for (i = 0; i < stub_entry->stub_template_size; i++)
     {
-      switch(template[i].type)
+      switch (template[i].type)
 	{
 	case ARM_TYPE:
 	  sym_type = ARM_MAP_ARM;
@@ -11751,6 +11751,7 @@ arm_map_one_stub (struct bfd_hash_entry 
 
 	default:
 	  BFD_FAIL ();
+	  return FALSE;
 	}
 
       if (template[i].type != prev_type)
@@ -11760,7 +11761,7 @@ arm_map_one_stub (struct bfd_hash_entry 
 	    return FALSE;
 	}
 
-      switch(template[i].type)
+      switch (template[i].type)
 	{
 	case ARM_TYPE:
 	  size += 4;
@@ -11776,6 +11777,7 @@ arm_map_one_stub (struct bfd_hash_entry 
 
 	default:
 	  BFD_FAIL ();
+	  return FALSE;
 	}
     }
 


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