diff options
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 19c1a03..136e4a6 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -790,36 +790,31 @@ std::string Dwarf_line_info::one_addr2line(Object* object, unsigned int shndx, off_t offset) { - if (parameters->get_size() == 32 && !parameters->is_big_endian()) + switch (parameters->size_and_endianness()) + { #ifdef HAVE_TARGET_32_LITTLE - return Sized_dwarf_line_info<32, false>(object, shndx).addr2line(shndx, - offset); -#else - gold_unreachable(); + case Parameters::TARGET_32_LITTLE: + return Sized_dwarf_line_info<32, false>(object, shndx).addr2line(shndx, + offset); #endif - else if (parameters->get_size() == 32 && parameters->is_big_endian()) #ifdef HAVE_TARGET_32_BIG - return Sized_dwarf_line_info<32, true>(object, shndx).addr2line(shndx, - offset); -#else - gold_unreachable(); + case Parameters::TARGET_32_BIG: + return Sized_dwarf_line_info<32, true>(object, shndx).addr2line(shndx, + offset); #endif - else if (parameters->get_size() == 64 && !parameters->is_big_endian()) #ifdef HAVE_TARGET_64_LITTLE - return Sized_dwarf_line_info<64, false>(object, shndx).addr2line(shndx, - offset); -#else - gold_unreachable(); + case Parameters::TARGET_64_LITTLE: + return Sized_dwarf_line_info<64, false>(object, shndx).addr2line(shndx, + offset); #endif - else if (parameters->get_size() == 64 && parameters->is_big_endian()) -#ifdef HAVE_TARGET_64_BIT - return Sized_dwarf_line_info<64, true>(object, shndx).addr2line(shndx, - offset); -#else - gold_unreachable(); +#ifdef HAVE_TARGET_64_BIG + case Parameters::TARGET_64_BIG: + return Sized_dwarf_line_info<64, true>(object, shndx).addr2line(shndx, + offset); #endif - else - gold_unreachable(); + default: + gold_unreachable(); + } } #ifdef HAVE_TARGET_32_LITTLE |