[PATCH][GOLD] Rearrange code to fix build breakage due to a conversion warning.

Doug Kwan (關振德) dougkwan@google.com
Fri Mar 26 04:20:00 GMT 2010


Hi,

     This fixes a problem in which a conversion from -1 to the
unsigned int type causes a build breakage when gold is build for
i686-unknown-linux-gnu.  This has been tested by building gold as a
cross linker for host i686-unknown-linux-gnu and as a native linker
for arm-unknown-linux-gnu.

-Doug

2010-03-25  Doug Kwan  <dougkwan@google.com>

        * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
        to avoid a conversion warning on a 32-bit host.
-------------- next part --------------
Index: gold/arm.cc
===================================================================
RCS file: /cvs/src/src/gold/arm.cc,v
retrieving revision 1.94
diff -u -u -p -r1.94 arm.cc
--- gold/arm.cc	22 Mar 2010 22:48:05 -0000	1.94
+++ gold/arm.cc	26 Mar 2010 02:36:56 -0000
@@ -5206,10 +5206,11 @@ Arm_exidx_fixup::update_offset_map(
 {
   if (this->section_offset_map_ == NULL)
     this->section_offset_map_ = new Arm_exidx_section_offset_map();
-  section_offset_type output_offset =
-    (delete_entry
-     ? Arm_exidx_input_section::invalid_offset
-     : input_offset - deleted_bytes);
+  section_offset_type output_offset;
+  if (delete_entry)
+    output_offset = Arm_exidx_input_section::invalid_offset;
+  else
+    output_offset = input_offset - deleted_bytes;
   (*this->section_offset_map_)[input_offset] = output_offset;
 }
 


More information about the Binutils mailing list