aboutsummaryrefslogtreecommitdiff
path: root/gold/archive.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2008-07-25 04:25:49 +0000
committerIan Lance Taylor <ian@airs.com>2008-07-25 04:25:49 +0000
commit2a00e4fb8e170de97cb80a0140ba4d42a8ffd42f (patch)
treebd6483e0ea6e9704286a6ff02d732a79c29e91cf /gold/archive.cc
parente2df110677592d7b096d7ea9a20d695b49555037 (diff)
downloadgdb-2a00e4fb8e170de97cb80a0140ba4d42a8ffd42f.zip
gdb-2a00e4fb8e170de97cb80a0140ba4d42a8ffd42f.tar.gz
gdb-2a00e4fb8e170de97cb80a0140ba4d42a8ffd42f.tar.bz2
PR 5990
* descriptors.cc: New file. * descriptors.h: New file. * gold-threads.h (class Hold_optional_lock): New class. * fileread.cc: Include "descriptors.h". (File_read::~File_read): Release descriptor rather than closing it. (File_read::open) [file]: Call open_descriptor rather than open. Set is_descriptor_opened_. (File_read::open) [memory]: Assert that descriptor is not open. (File_read::reopen_descriptor): New function. (File_read::release): Release descriptor. (File_read::do_read): Make non-const. Reopen descriptor. (File_read::read): Make non-const. (File_read::make_view): Reopen descriptor. (File_read::do_readv): Likewise. * fileread.h (class File_read): Add is_descriptor_opened_ field. Update declarations. * layout.cc: Include "descriptors.h". (Layout::create_build_id): Use open_descriptor rather than open. * output.cc: Include "descriptors.h". (Output_file::open): Use open_descriptor rather than open. * archive.cc (Archive::const_iterator): Change Archive to be non-const. (Archive::begin, Archive::end): Make non-const. (Archive::count_members): Likewise. * archive.h (class Archive): Update declarations. * object.h (Object::read): Make non-const. * Makefile.am (CCFILES): Add descriptors.cc. (HFILES): Add descriptors.h. * Makefile.in: Rebuild.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r--gold/archive.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/gold/archive.cc b/gold/archive.cc
index 8d11797..27f4380 100644
--- a/gold/archive.cc
+++ b/gold/archive.cc
@@ -384,7 +384,7 @@ class Archive::const_iterator
off_t size;
};
- const_iterator(const Archive* archive, off_t off)
+ const_iterator(Archive* archive, off_t off)
: archive_(archive), off_(off)
{ this->read_next_header(); }
@@ -431,7 +431,7 @@ class Archive::const_iterator
read_next_header();
// The underlying archive.
- const Archive* archive_;
+ Archive* archive_;
// The current offset in the file.
off_t off_;
// The current archive header.
@@ -481,7 +481,7 @@ Archive::const_iterator::read_next_header()
// Initial iterator.
Archive::const_iterator
-Archive::begin() const
+Archive::begin()
{
return Archive::const_iterator(this, sarmag);
}
@@ -489,7 +489,7 @@ Archive::begin() const
// Final iterator.
Archive::const_iterator
-Archive::end() const
+Archive::end()
{
return Archive::const_iterator(this, this->input_file_->file().filesize());
}
@@ -515,7 +515,7 @@ Archive::include_all_members(Symbol_table* symtab, Layout* layout,
// reports.
size_t
-Archive::count_members() const
+Archive::count_members()
{
size_t ret = 0;
for (Archive::const_iterator p = this->begin();