]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2010-01-13 Doug Kwan <dougkwan@google.com>
authorDoug Kwan <dougkwan@google.com>
Thu, 14 Jan 2010 02:42:20 +0000 (02:42 +0000)
committerDoug Kwan <dougkwan@google.com>
Thu, 14 Jan 2010 02:42:20 +0000 (02:42 +0000)
* arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
apparent compiler problem of not folding static constant integral
data members of elfcpp::Elf_sizes<32>.

gold/ChangeLog
gold/arm.cc

index 32d7fb7b56cd3570b5ac93b9f3d40d30c46a4446..c6d0c160d7882d6d0dd9ddd604989f945b9f238e 100644 (file)
@@ -1,3 +1,10 @@
+2010-01-13  Doug Kwan  <dougkwan@google.com>
+
+       * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
+       Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
+       apparent compiler problem of not folding static constant integral
+       data members of elfcpp::Elf_sizes<32>.
+
 2010-01-13  Doug Kwan  <dougkwan@google.com>
 
        * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
index c9ea2fd8ecd8f8dcf346801fc6f93c4195555010..38f9d71a648ae2ececc5b1b91e452ca924a43f8f 100644 (file)
@@ -4203,9 +4203,11 @@ Arm_relobj<big_endian>::section_needs_reloc_stub_scanning(
   if (this->adjust_shndx(shdr.get_sh_link()) != this->symtab_shndx())
     return false;
 
-  const unsigned int reloc_size = (sh_type == elfcpp::SHT_REL
-                                  ? elfcpp::Elf_sizes<32>::rel_size
-                                  : elfcpp::Elf_sizes<32>::rela_size);
+  unsigned int reloc_size;
+  if (sh_type == elfcpp::SHT_REL)
+    reloc_size = elfcpp::Elf_sizes<32>::rel_size;
+  else
+    reloc_size = elfcpp::Elf_sizes<32>::rela_size;
 
   // Ignore reloc section with unexpected entsize or uneven size.
   // The error will be reported in the final link.
@@ -4380,9 +4382,11 @@ Arm_relobj<big_endian>::scan_sections_for_stubs(
          relinfo.reloc_shndx = i;
          relinfo.data_shndx = index;
          unsigned int sh_type = shdr.get_sh_type();
-         const unsigned int reloc_size = (sh_type == elfcpp::SHT_REL
-                                          ? elfcpp::Elf_sizes<32>::rel_size
-                                          : elfcpp::Elf_sizes<32>::rela_size);
+         unsigned int reloc_size;
+         if (sh_type == elfcpp::SHT_REL)
+           reloc_size = elfcpp::Elf_sizes<32>::rel_size;
+         else
+           reloc_size = elfcpp::Elf_sizes<32>::rela_size;
 
          Output_section* os = out_sections[index];
          arm_target->scan_section_for_stubs(&relinfo, sh_type, prelocs,