diff options
author | Ian Lance Taylor <iant@google.com> | 2008-02-28 00:18:24 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2008-02-28 00:18:24 +0000 |
commit | 8851eccaec28f25f56fab5ba5d8ae44f71729975 (patch) | |
tree | 8580999a45a15a7e86dbabb0675a05f647aedd1a /gold/ehframe.cc | |
parent | f960754aeea602f787d1828efb0f9a8baeca646e (diff) | |
download | gdb-8851eccaec28f25f56fab5ba5d8ae44f71729975.zip gdb-8851eccaec28f25f56fab5ba5d8ae44f71729975.tar.gz gdb-8851eccaec28f25f56fab5ba5d8ae44f71729975.tar.bz2 |
From Craig Silverstein: Have Parameters point to General_options.
Diffstat (limited to 'gold/ehframe.cc')
-rw-r--r-- | gold/ehframe.cc | 90 |
1 files changed, 30 insertions, 60 deletions
diff --git a/gold/ehframe.cc b/gold/ehframe.cc index 8306f51..df94488 100644 --- a/gold/ehframe.cc +++ b/gold/ehframe.cc @@ -109,46 +109,31 @@ Eh_frame_hdr::set_final_data_size() void Eh_frame_hdr::do_write(Output_file* of) { - if (parameters->get_size() == 32) + switch (parameters->size_and_endianness()) { - if (!parameters->is_big_endian()) - { #ifdef HAVE_TARGET_32_LITTLE - this->do_sized_write<32, false>(of); -#else - gold_unreachable(); + case Parameters::TARGET_32_LITTLE: + this->do_sized_write<32, false>(of); + break; #endif - } - else - { #ifdef HAVE_TARGET_32_BIG - this->do_sized_write<32, true>(of); -#else - gold_unreachable(); + case Parameters::TARGET_32_BIG: + this->do_sized_write<32, true>(of); + break; #endif - } - } - else if (parameters->get_size() == 64) - { - if (!parameters->is_big_endian()) - { #ifdef HAVE_TARGET_64_LITTLE - this->do_sized_write<64, false>(of); -#else - gold_unreachable(); + case Parameters::TARGET_64_LITTLE: + this->do_sized_write<64, false>(of); + break; #endif - } - else - { #ifdef HAVE_TARGET_64_BIG - this->do_sized_write<64, true>(of); -#else - gold_unreachable(); + case Parameters::TARGET_64_BIG: + this->do_sized_write<64, true>(of); + break; #endif - } + default: + gold_unreachable(); } - else - gold_unreachable(); } // Write the data to the file with the right endianness. @@ -1075,46 +1060,31 @@ Eh_frame::do_write(Output_file* of) const off_t oview_size = this->data_size(); unsigned char* const oview = of->get_output_view(offset, oview_size); - if (parameters->get_size() == 32) + switch (parameters->size_and_endianness()) { - if (!parameters->is_big_endian()) - { #ifdef HAVE_TARGET_32_LITTLE - this->do_sized_write<32, false>(oview); -#else - gold_unreachable(); + case Parameters::TARGET_32_LITTLE: + this->do_sized_write<32, false>(oview); + break; #endif - } - else - { #ifdef HAVE_TARGET_32_BIG - this->do_sized_write<32, true>(oview); -#else - gold_unreachable(); + case Parameters::TARGET_32_BIG: + this->do_sized_write<32, true>(oview); + break; #endif - } - } - else if (parameters->get_size() == 64) - { - if (!parameters->is_big_endian()) - { #ifdef HAVE_TARGET_64_LITTLE - this->do_sized_write<64, false>(oview); -#else - gold_unreachable(); + case Parameters::TARGET_64_LITTLE: + this->do_sized_write<64, false>(oview); + break; #endif - } - else - { #ifdef HAVE_TARGET_64_BIG - this->do_sized_write<64, true>(oview); -#else - gold_unreachable(); + case Parameters::TARGET_64_BIG: + this->do_sized_write<64, true>(oview); + break; #endif - } + default: + gold_unreachable(); } - else - gold_unreachable(); of->write_output_view(offset, oview_size, oview); } |