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/reloc.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gold/reloc.cc') diff --git a/gold/reloc.cc b/gold/reloc.cc index e4601a3..c94aa9b 100644 --- a/gold/reloc.cc +++ b/gold/reloc.cc @@ -197,7 +197,7 @@ Sized_relobj::do_read_relocs(Read_relocs_data* rd) const unsigned char *pshdrs = this->get_view(this->elf_file_.shoff(), shnum * This::shdr_size, - true); + true, true); // Skip the first, dummy, section. const unsigned char *ps = pshdrs + This::shdr_size; for (unsigned int i = 1; i < shnum; ++i, ps += This::shdr_size) @@ -269,7 +269,7 @@ Sized_relobj::do_read_relocs(Read_relocs_data* rd) sr.reloc_shndx = i; sr.data_shndx = shndx; sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size, - true); + true, true); sr.sh_type = sh_type; sr.reloc_count = reloc_count; sr.output_section = os; @@ -291,7 +291,7 @@ Sized_relobj::do_read_relocs(Read_relocs_data* rd) gold_assert(loccount == symtabshdr.get_sh_info()); off_t locsize = loccount * sym_size; rd->local_symbols = this->get_lasting_view(symtabshdr.get_sh_offset(), - locsize, true); + locsize, true, true); } } @@ -465,7 +465,7 @@ Sized_relobj::do_relocate(const General_options& options, // Read the section headers. const unsigned char* pshdrs = this->get_view(this->elf_file_.shoff(), shnum * This::shdr_size, - true); + true, true); Views views; views.resize(shnum); @@ -745,7 +745,7 @@ Sized_relobj::relocate_sections( off_t sh_size = shdr.get_sh_size(); const unsigned char* prelocs = this->get_view(shdr.get_sh_offset(), - sh_size, false); + sh_size, true, false); unsigned int reloc_size; if (sh_type == elfcpp::SHT_REL) -- cgit v1.1