aboutsummaryrefslogtreecommitdiff
path: root/gold/layout.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2006-11-16 00:38:25 +0000
committerIan Lance Taylor <iant@google.com>2006-11-16 00:38:25 +0000
commitc06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e (patch)
tree732f3a1719d66e1fd993872ecd58ca282d2858f8 /gold/layout.cc
parent7495b3afc0d28e2d64995f383e2436a35aa14e6d (diff)
downloadgdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.zip
gdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.tar.gz
gdb-c06b7b0ba3f6aaa4a3f9586689ef8bfdbd17454e.tar.bz2
Snapshot. Includes first cut at output relocation sections.
Diffstat (limited to 'gold/layout.cc')
-rw-r--r--gold/layout.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/gold/layout.cc b/gold/layout.cc
index bcb1029..f9f5548 100644
--- a/gold/layout.cc
+++ b/gold/layout.cc
@@ -676,19 +676,24 @@ Layout::create_symtab_sections(int size, const Input_objects* input_objects,
// Save space for the dummy symbol at the start of the section. We
// never bother to write this out--it will just be left as zero.
off += symsize;
+ unsigned int local_symbol_index = 1;
for (Input_objects::Relobj_iterator p = input_objects->relobj_begin();
p != input_objects->relobj_end();
++p)
{
Task_lock_obj<Object> tlo(**p);
- off = (*p)->finalize_local_symbols(off, &this->sympool_);
+ unsigned int index = (*p)->finalize_local_symbols(local_symbol_index,
+ off,
+ &this->sympool_);
+ off += (index - local_symbol_index) * symsize;
+ local_symbol_index = index;
}
- unsigned int local_symcount = (off - startoff) / symsize;
+ unsigned int local_symcount = local_symbol_index;
assert(local_symcount * symsize == off - startoff);
- off = symtab->finalize(off, &this->sympool_);
+ off = symtab->finalize(local_symcount, off, &this->sympool_);
this->sympool_.set_string_offsets();