summaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorCraig Silverstein <csilvers@google.com>2008-05-01 00:25:33 +0000
committerCraig Silverstein <csilvers@google.com>2008-05-01 00:25:33 +0000
commit07ce048475bcfb844f9e50da8d95d8196a7d44d2 (patch)
treed29ca283bed930a6b47ba9ccf5d4633a3cd2d253 /gold/symtab.cc
parentaea8dac613c71d1e62d9aaf468a56c3fb8f87ea1 (diff)
downloadbinutils-redhat-07ce048475bcfb844f9e50da8d95d8196a7d44d2.tar.gz
* dwarf_reader.cc (next_generation_count): New static var.
(Addr2line_cache_entry): New struct. (addr2line_cache): New static var. (Dwarf_line_info::one_addr2line): Added caching. (Dwarf_line_info::clear_addr2line_cache): New function. * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add cache-size parameter. (Dwarf_line_info::one_addr2line_cache): New function. * symtab.cc (Symbol_table::detect_odr_violations): Pass new cache-size argument to one_addr2line(), and clear cache.
Diffstat (limited to 'gold/symtab.cc')
-rw-r--r--gold/symtab.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index eeb32fdd57..170a209368 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -2343,10 +2343,12 @@ Symbol_table::detect_odr_violations(const Task* task,
// want to run this in a general Task for better
// performance, we will need one Task for object, plus
// appropriate locking to ensure that we don't conflict with
- // other uses of the object.
+ // other uses of the object. Also note, one_addr2line is not
+ // currently thread-safe.
Task_lock_obj<Object> tl(task, locs->object);
+ // 16 is the size of the object-cache that one_addr2line should use.
std::string lineno = Dwarf_line_info::one_addr2line(
- locs->object, locs->shndx, locs->offset);
+ locs->object, locs->shndx, locs->offset, 16);
if (!lineno.empty())
line_nums.insert(lineno);
}
@@ -2362,6 +2364,8 @@ Symbol_table::detect_odr_violations(const Task* task,
fprintf(stderr, " %s\n", it2->c_str());
}
}
+ // We only call one_addr2line() in this function, so we can clear its cache.
+ Dwarf_line_info::clear_addr2line_cache();
}
// Warnings functions.