]> Git Repo - binutils.git/blobdiff - gold/dwarf_reader.cc
* README: Rewrite, with some notes on unsupported features.
[binutils.git] / gold / dwarf_reader.cc
index 19c1a035ac0f224e4f5708a38ca14c927e0f4861..f2ae53a955fa1be46484e2d5ecd4ab2ec9cd029e 100644 (file)
@@ -1,6 +1,6 @@
 // dwarf_reader.cc -- parse dwarf2/3 debug information
 
-// Copyright 2007 Free Software Foundation, Inc.
+// Copyright 2007, 2008 Free Software Foundation, Inc.
 // Written by Ian Lance Taylor <[email protected]>.
 
 // This file is part of gold.
@@ -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
This page took 0.022132 seconds and 4 git commands to generate.