From 39d0cb0e83f9eb33feb96a18f24607065426d089 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 2 Apr 2008 20:58:21 +0000 Subject: * fileread.cc (File_read::find_view): Add byteshift and vshifted parameters. Update for new key type to views_. Change all callers. (File_read::read): Adjust for byteshift in returned view. (File_read::add_view): New function, broken out of find_and_make_view. (File_read::make_view): New function, broken out of find_and_make_view. (File_read::find_or_make_view): Add offset and aligned parameters. Rewrite accordingly. Change all callers. (File_read::get_view): Add offset and aligned parameters. Adjust for byteshift in return value. (File_read::get_lasting_view): Likewise. * fileread.h (class File_read): Update declarations. (class File_read::View): Add byteshift_ field. Add byteshift to constructor. Add byteshift method. * archive.h (Archive::clear_uncached_views): New function. (Archive::get_view): Add aligned parameter. Change all callers. * object.h (Object::get_view): Add aligned parameter. Change all callers. (Object::get_lasting_view): Likewise. * fileread.cc (File_read::release): Don't call clear_views if there are multiple objects. * fileread.h (File_read::clear_uncached_views): New function. * archive.cc (Add_archive_symbols::run): Call clear_uncached_views on the archive. --- gold/archive.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gold/archive.cc') diff --git a/gold/archive.cc b/gold/archive.cc index 222db96..25708ee 100644 --- a/gold/archive.cc +++ b/gold/archive.cc @@ -112,7 +112,7 @@ Archive::setup() if (xname == "/") { const unsigned char* p = this->get_view(off + sizeof(Archive_header), - extended_size, true); + extended_size, false, true); const char* px = reinterpret_cast(p); this->extended_names_.assign(px, extended_size); } @@ -137,7 +137,7 @@ void Archive::read_armap(off_t start, section_size_type size) { // Read in the entire armap. - const unsigned char* p = this->get_view(start, size, false); + const unsigned char* p = this->get_view(start, size, true, false); // Numbers in the armap are always big-endian. const elfcpp::Elf_Word* pword = reinterpret_cast(p); @@ -178,7 +178,8 @@ off_t Archive::read_header(off_t off, bool cache, std::string* pname, off_t* nested_off) { - const unsigned char* p = this->get_view(off, sizeof(Archive_header), cache); + const unsigned char* p = this->get_view(off, sizeof(Archive_header), true, + cache); const Archive_header* hdr = reinterpret_cast(p); return this->interpret_header(hdr, off, pname, nested_off); } @@ -554,6 +555,7 @@ Add_archive_symbols::run(Workqueue*) this->archive_->unlock_nested_archives(); this->archive_->release(); + this->archive_->clear_uncached_views(); if (this->input_group_ != NULL) this->input_group_->add_archive(this->archive_); -- cgit v1.1