aboutsummaryrefslogtreecommitdiff
path: root/gold/dwarf_reader.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2010-07-12 17:59:58 +0000
committerCary Coutant <ccoutant@google.com>2010-07-12 17:59:58 +0000
commita2e4736229d6ce6f804ed26ea8d763c538de9d2c (patch)
tree25de3c95f1bf545500aa9adf3278422f477ace18 /gold/dwarf_reader.cc
parentadd265ae415ecd40208537d1f84155f868668ef5 (diff)
downloadgdb-a2e4736229d6ce6f804ed26ea8d763c538de9d2c.zip
gdb-a2e4736229d6ce6f804ed26ea8d763c538de9d2c.tar.gz
gdb-a2e4736229d6ce6f804ed26ea8d763c538de9d2c.tar.bz2
* compressed_output.cc (zlib_decompress): New function.
(get_uncompressed_size): New function. (decompress_input_section): New function. * compressed_output.h (get_uncompressed_size): New function. (decompress_input_section): New function. * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info) Handle compressed debug sections. * layout.cc (is_compressed_debug_section): New function. (Layout::output_section_name): Map compressed section names to canonical names. * layout.h (is_compressed_debug_section): New function. (is_debug_info_section): Recognize compressed debug sections. * merge.cc: Include compressed_output.h. (Output_merge_data::do_add_input_section): Handle compressed debug sections. (Output_merge_string::do_add_input_section): Handle compressed debug sections. * object.cc: Include compressed_output.h. (Sized_relobj::Sized_relobj): Initialize new data members. (build_compressed_section_map): New function. (Sized_relobj::do_read_symbols): Handle compressed debug sections. * object.h (Object::section_is_compressed): New method. (Object::do_section_is_compressed): New method. (Sized_relobj::Compressed_section_map): New type. (Sized_relobj::do_section_is_compressed): New method. (Sized_relobj::compressed_sections_): New data member. * output.cc (Output_section::add_input_section): Handle compressed debug sections. * reloc.cc: Include compressed_output.h. (Sized_relobj::write_sections): Handle compressed debug sections.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r--gold/dwarf_reader.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc
index 4062fe6..c0188fb 100644
--- a/gold/dwarf_reader.cc
+++ b/gold/dwarf_reader.cc
@@ -32,6 +32,7 @@
#include "reloc.h"
#include "dwarf_reader.h"
#include "int_encoding.h"
+#include "compressed_output.h"
namespace gold {
@@ -80,6 +81,21 @@ Sized_dwarf_line_info<size, big_endian>::Sized_dwarf_line_info(Object* object,
if (this->buffer_ == NULL)
return;
+ section_size_type uncompressed_size = 0;
+ unsigned char* uncompressed_data = NULL;
+ if (object->section_is_compressed(debug_shndx, &uncompressed_size))
+ {
+ uncompressed_data = new unsigned char[uncompressed_size];
+ if (!decompress_input_section(this->buffer_,
+ this->buffer_end_ - this->buffer_,
+ uncompressed_data,
+ uncompressed_size))
+ object->error(_("could not decompress section %s"),
+ object->section_name(debug_shndx).c_str());
+ this->buffer_ = uncompressed_data;
+ this->buffer_end_ = this->buffer_ + uncompressed_size;
+ }
+
// Find the relocation section for ".debug_line".
// We expect these for relobjs (.o's) but not dynobjs (.so's).
bool got_relocs = false;