aboutsummaryrefslogtreecommitdiff
path: root/gold/reloc.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-09-25 17:50:26 +0000
committerIan Lance Taylor <iant@google.com>2007-09-25 17:50:26 +0000
commit9eb9fa57c2a9eec4c08491715d3341df811b7f9c (patch)
treec68eac98b999ebfb3251ab5f9851900bf8e4179b /gold/reloc.cc
parent0b058123a01a282fe112ee8863bfbf0abf89f29b (diff)
downloadgdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.zip
gdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.tar.gz
gdb-9eb9fa57c2a9eec4c08491715d3341df811b7f9c.tar.bz2
Add cache parameter to get_view. Discard uncached views on unlock.
Fix bug this exposed in archive armap symbol name handling.
Diffstat (limited to 'gold/reloc.cc')
-rw-r--r--gold/reloc.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/gold/reloc.cc b/gold/reloc.cc
index d4674bb..ad3bb05 100644
--- a/gold/reloc.cc
+++ b/gold/reloc.cc
@@ -172,7 +172,8 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
rd->relocs.reserve(shnum / 2);
const unsigned char *pshdrs = this->get_view(this->elf_file_.shoff(),
- shnum * This::shdr_size);
+ shnum * This::shdr_size,
+ 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)
@@ -242,7 +243,8 @@ Sized_relobj<size, big_endian>::do_read_relocs(Read_relocs_data* rd)
Section_relocs& sr(rd->relocs.back());
sr.reloc_shndx = i;
sr.data_shndx = shndx;
- sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size);
+ sr.contents = this->get_lasting_view(shdr.get_sh_offset(), sh_size,
+ true);
sr.sh_type = sh_type;
sr.reloc_count = reloc_count;
}
@@ -261,7 +263,7 @@ Sized_relobj<size, big_endian>::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);
+ locsize, true);
}
}
@@ -316,7 +318,8 @@ Sized_relobj<size, big_endian>::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);
+ shnum * This::shdr_size,
+ true);
Views views;
views.resize(shnum);
@@ -455,7 +458,7 @@ Sized_relobj<size, big_endian>::relocate_sections(
off_t sh_size = shdr.get_sh_size();
const unsigned char* prelocs = this->get_view(shdr.get_sh_offset(),
- sh_size);
+ sh_size, false);
unsigned int reloc_size;
if (sh_type == elfcpp::SHT_REL)