summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/base/loader/elf_object.cc6
-rw-r--r--src/base/loader/elf_object.hh2
-rw-r--r--src/base/loader/object_file.hh3
-rw-r--r--src/sim/process.cc3
4 files changed, 13 insertions, 1 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index f6a18db8a..b6253adbe 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -415,6 +415,12 @@ ElfObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
}
bool
+ElfObject::loadWeakSymbols(SymbolTable *symtab, Addr addrMask)
+{
+ return loadSomeSymbols(symtab, STB_WEAK, addrMask);
+}
+
+bool
ElfObject::loadSections(PortProxy& memProxy, Addr addrMask)
{
if (!ObjectFile::loadSections(memProxy, addrMask))
diff --git a/src/base/loader/elf_object.hh b/src/base/loader/elf_object.hh
index 350a80db1..d3d3e5197 100644
--- a/src/base/loader/elf_object.hh
+++ b/src/base/loader/elf_object.hh
@@ -71,6 +71,8 @@ class ElfObject : public ObjectFile
std::numeric_limits<Addr>::max());
virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
std::numeric_limits<Addr>::max());
+ virtual bool loadWeakSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
virtual bool isDynamic() { return sectionExists(".interp"); }
virtual bool hasTLS() { return sectionExists(".tbss"); }
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index 4a789d321..bdc9a31a1 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -89,6 +89,9 @@ class ObjectFile
std::numeric_limits<Addr>::max()) = 0;
virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
std::numeric_limits<Addr>::max()) = 0;
+ virtual bool loadWeakSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max())
+ { return false; }
virtual bool isDynamic() { return false; }
virtual bool hasTLS() { return false; }
diff --git a/src/sim/process.cc b/src/sim/process.cc
index 22a886303..1654ea5c5 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -574,7 +574,8 @@ LiveProcess::LiveProcess(LiveProcessParams * params, ObjectFile *_objFile)
if (!debugSymbolTable) {
debugSymbolTable = new SymbolTable();
if (!objFile->loadGlobalSymbols(debugSymbolTable) ||
- !objFile->loadLocalSymbols(debugSymbolTable)) {
+ !objFile->loadLocalSymbols(debugSymbolTable) ||
+ !objFile->loadWeakSymbols(debugSymbolTable)) {
// didn't load any symbols
delete debugSymbolTable;
debugSymbolTable = NULL;