aboutsummaryrefslogtreecommitdiff
path: root/gold/dynobj.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-04-02 20:58:21 +0000
committerIan Lance Taylor <ian@airs.com>2008-04-02 20:58:21 +0000
commit39d0cb0e83f9eb33feb96a18f24607065426d089 (patch)
tree3b147c4a9fe94f4eb2cb847999db7adc5ae70e5c /gold/dynobj.cc
parent5caffa0e9b4a3cab0749be6b30fa7ebeda6b62f5 (diff)
downloadfsf-binutils-gdb-39d0cb0e83f9eb33feb96a18f24607065426d089.zip
fsf-binutils-gdb-39d0cb0e83f9eb33feb96a18f24607065426d089.tar.gz
fsf-binutils-gdb-39d0cb0e83f9eb33feb96a18f24607065426d089.tar.bz2
* 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.
Diffstat (limited to 'gold/dynobj.cc')
-rw-r--r--gold/dynobj.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc
index b686867..e593b89 100644
--- a/gold/dynobj.cc
+++ b/gold/dynobj.cc
@@ -183,7 +183,7 @@ Sized_dynobj<size, big_endian>::read_dynsym_section(
shndx, shdr.get_sh_link(), link);
*view = this->get_lasting_view(shdr.get_sh_offset(), shdr.get_sh_size(),
- false);
+ true, false);
*view_size = convert_to_section_size_type(shdr.get_sh_size());
*view_info = shdr.get_sh_info();
}
@@ -208,7 +208,7 @@ Sized_dynobj<size, big_endian>::read_dynamic(const unsigned char* pshdrs,
const off_t dynamic_size = dynamicshdr.get_sh_size();
const unsigned char* pdynamic = this->get_view(dynamicshdr.get_sh_offset(),
- dynamic_size, false);
+ dynamic_size, true, false);
const unsigned int link = dynamicshdr.get_sh_link();
if (link != strtab_shndx)
@@ -229,7 +229,8 @@ Sized_dynobj<size, big_endian>::read_dynamic(const unsigned char* pshdrs,
}
strtab_size = strtabshdr.get_sh_size();
- strtabu = this->get_view(strtabshdr.get_sh_offset(), strtab_size, false);
+ strtabu = this->get_view(strtabshdr.get_sh_offset(), strtab_size, false,
+ false);
}
const char* const strtab = reinterpret_cast<const char*>(strtabu);
@@ -313,7 +314,8 @@ Sized_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
gold_assert(dynsymshdr.get_sh_type() == elfcpp::SHT_DYNSYM);
sd->symbols = this->get_lasting_view(dynsymshdr.get_sh_offset(),
- dynsymshdr.get_sh_size(), false);
+ dynsymshdr.get_sh_size(), true,
+ false);
sd->symbols_size =
convert_to_section_size_type(dynsymshdr.get_sh_size());
@@ -336,7 +338,7 @@ Sized_dynobj<size, big_endian>::do_read_symbols(Read_symbols_data* sd)
sd->symbol_names = this->get_lasting_view(strtabshdr.get_sh_offset(),
strtabshdr.get_sh_size(),
- false);
+ false, false);
sd->symbol_names_size =
convert_to_section_size_type(strtabshdr.get_sh_size());