gold/
authorCary Coutant <ccoutant@google.com>
Fri, 1 Mar 2013 22:53:02 +0000 (22:53 +0000)
committerCary Coutant <ccoutant@google.com>
Fri, 1 Mar 2013 22:53:02 +0000 (22:53 +0000)
* dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
function into class definition in header file.
(Dwarf_info_reader::warn_corrupt_debug_section): New function.
* dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
New function.
(Dwarf_info_reader::check_buffer): Move here from .cc file.

gold/ChangeLog
gold/dwarf_reader.cc
gold/dwarf_reader.h

index 0aa655ea4979bbe229c38b2b0cde0980ab894d18..61747b06d32ee103a2643cc1b88763e509e6ad7a 100644 (file)
@@ -1,3 +1,12 @@
+2013-03-01  Cary Coutant  <ccoutant@google.com>
+
+       * dwarf_reader.cc (Dwarf_info_reader::check_buffer): Move
+       function into class definition in header file.
+       (Dwarf_info_reader::warn_corrupt_debug_section): New function.
+       * dwarf_reader.h (Dwarf_info_reader::warn_corrupt_debug_section):
+       New function.
+       (Dwarf_info_reader::check_buffer): Move here from .cc file.
+
 2013-02-28  Alan Modra  <amodra@gmail.com>
 
        * target.h (Target::plt_fde_location, do_plt_fde_location): Declare.
index ec0e845564863af809005a07dbf619a634d42d7a..de4141827cf870a675e82381a69a2c231b605aa7 100644 (file)
@@ -1141,21 +1141,6 @@ Dwarf_die::sibling_offset()
 
 // class Dwarf_info_reader
 
-// Check that the pointer P is within the current compilation unit.
-
-inline bool
-Dwarf_info_reader::check_buffer(const unsigned char* p) const
-{
-  if (p > this->buffer_ + this->cu_offset_ + this->cu_length_)
-    {
-      gold_warning(_("%s: corrupt debug info in %s"),
-                  this->object_->name().c_str(),
-                  this->object_->section_name(this->shndx_).c_str());
-      return false;
-    }
-  return true;
-}
-
 // Begin parsing the debug info.  This calls visit_compilation_unit()
 // or visit_type_unit() for each compilation or type unit found in the
 // section, and visit_die() for each top-level DIE.
@@ -1447,6 +1432,16 @@ Dwarf_info_reader::visit_type_unit(off_t, off_t, uint64_t, Dwarf_die*)
 {
 }
 
+// Print a warning about a corrupt debug section.
+
+void
+Dwarf_info_reader::warn_corrupt_debug_section() const
+{
+  gold_warning(_("%s: corrupt debug info in %s"),
+              this->object_->name().c_str(),
+              this->object_->section_name(this->shndx_).c_str());
+}
+
 // class Sized_dwarf_line_info
 
 struct LineStateMachine
index 2a8e56edd5151ace1e00c900af0f6e009bf9d6ad..0285ca8cbe23f732edfb7c3d0b16d39bd8f69d2c 100644 (file)
@@ -799,9 +799,21 @@ class Dwarf_info_reader
   { this->reloc_mapper_->reset(checkpoint); }
 
  private:
+  // Print a warning about a corrupt debug section.
+  void
+  warn_corrupt_debug_section() const;
+
   // Check that P is within the bounds of the current section.
   bool
-  check_buffer(const unsigned char* p) const;
+  check_buffer(const unsigned char* p) const
+  {
+    if (p > this->buffer_ + this->cu_offset_ + this->cu_length_)
+      {
+       this->warn_corrupt_debug_section();
+       return false;
+      }
+    return true;
+  }
 
   // Read the DWARF string table.
   bool