From b521dfe453f0590a99375d060a1e0a6f2fa9afec Mon Sep 17 00:00:00 2001 From: Doug Kwan Date: Thu, 14 Jan 2010 02:42:20 +0000 Subject: [PATCH] 2010-01-13 Doug Kwan * 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 | 7 +++++++ gold/arm.cc | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gold/ChangeLog b/gold/ChangeLog index 32d7fb7b56c..c6d0c160d78 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,10 @@ +2010-01-13 Doug Kwan + + * 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 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning, diff --git a/gold/arm.cc b/gold/arm.cc index c9ea2fd8ecd..38f9d71a648 100644 --- a/gold/arm.cc +++ b/gold/arm.cc @@ -4203,9 +4203,11 @@ Arm_relobj::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::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, -- 2.30.2