diff options
author | Ian Lance Taylor <iant@google.com> | 2008-01-02 23:48:49 +0000 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2008-01-02 23:48:49 +0000 |
commit | cb29561284eaa37c5c8967e49a5db0a4064368bf (patch) | |
tree | f4e88f9b60483aeb87c7cbfda3445f3da58edcc0 /gold/symtab.cc | |
parent | 2745d86e69ec4659f39cfe0406948578f791ac4f (diff) | |
download | gdb-cb29561284eaa37c5c8967e49a5db0a4064368bf.zip gdb-cb29561284eaa37c5c8967e49a5db0a4064368bf.tar.gz gdb-cb29561284eaa37c5c8967e49a5db0a4064368bf.tar.bz2 |
Reduce the number of system calls. Use readv instead of pread. Do
better handling of cached views.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r-- | gold/symtab.cc | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc index 4a1c5ee..a9f5138 100644 --- a/gold/symtab.cc +++ b/gold/symtab.cc @@ -1403,8 +1403,8 @@ Symbol_table::set_dynsym_indexes(const Target* target, // OFF. Add their names to POOL. Return the new file offset. off_t -Symbol_table::finalize(const Task* task, unsigned int index, off_t off, - off_t dynoff, size_t dyn_global_index, size_t dyncount, +Symbol_table::finalize(unsigned int index, off_t off, off_t dynoff, + size_t dyn_global_index, size_t dyncount, Stringpool* pool) { off_t ret; @@ -1437,7 +1437,7 @@ Symbol_table::finalize(const Task* task, unsigned int index, off_t off, // Now that we have the final symbol table, we can reliably note // which symbols should get warnings. - this->warnings_.note_warnings(this, task); + this->warnings_.note_warnings(this); return ret; } @@ -2004,10 +2004,10 @@ Symbol_table::detect_odr_violations(const Task* task, void Warnings::add_warning(Symbol_table* symtab, const char* name, Object* obj, - unsigned int shndx) + const std::string& warning) { name = symtab->canonicalize_name(name); - this->warnings_[name].set(obj, shndx); + this->warnings_[name].set(obj, warning); } // Look through the warnings and mark the symbols for which we should @@ -2015,7 +2015,7 @@ Warnings::add_warning(Symbol_table* symtab, const char* name, Object* obj, // sources for all the symbols. void -Warnings::note_warnings(Symbol_table* symtab, const Task* task) +Warnings::note_warnings(Symbol_table* symtab) { for (Warning_table::iterator p = this->warnings_.begin(); p != this->warnings_.end(); @@ -2025,24 +2025,7 @@ Warnings::note_warnings(Symbol_table* symtab, const Task* task) if (sym != NULL && sym->source() == Symbol::FROM_OBJECT && sym->object() == p->second.object) - { - sym->set_has_warning(); - - // Read the section contents to get the warning text. It - // would be nicer if we only did this if we have to actually - // issue a warning. Unfortunately, warnings are issued as - // we relocate sections. That means that we can not lock - // the object then, as we might try to issue the same - // warning multiple times simultaneously. - { - Task_lock_obj<Object> tl(task, p->second.object); - const unsigned char* c; - section_size_type len; - c = p->second.object->section_contents(p->second.shndx, &len, - false); - p->second.set_text(reinterpret_cast<const char*>(c), len); - } - } + sym->set_has_warning(); } } |