summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@arm.com>2010-08-23 11:18:39 -0500
committerAli Saidi <Ali.Saidi@arm.com>2010-08-23 11:18:39 -0500
commit4ab68fc999458617dbcfc91131404a1996e75482 (patch)
tree748f8c85b3a69d8efd5a75453a939d03e710ab84 /src
parentf2642e205549efefb7391de32b189e94e5503ddc (diff)
downloadgem5-4ab68fc999458617dbcfc91131404a1996e75482.tar.xz
Loader: Use address mask provided to load*Symbols when loading the symbols from the symbol table.
Diffstat (limited to 'src')
-rw-r--r--src/base/loader/elf_object.cc8
-rw-r--r--src/base/loader/elf_object.hh2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 6096cb2e3..9d9109ab4 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -335,7 +335,7 @@ ElfObject::ElfObject(const string &_filename, int _fd,
bool
-ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding)
+ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding, Addr mask)
{
Elf *elf;
int sec_idx = 1; // there is a 0 but it is nothing, go figure
@@ -375,7 +375,7 @@ ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding)
for (ii = 0; ii < count; ++ii) {
gelf_getsym(data, ii, &sym);
if (GELF_ST_BIND(sym.st_info) == binding) {
- symtab->insert(sym.st_value,
+ symtab->insert(sym.st_value & mask,
elf_strptr(elf, shdr.sh_link, sym.st_name));
}
}
@@ -392,13 +392,13 @@ ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding)
bool
ElfObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{
- return loadSomeSymbols(symtab, STB_GLOBAL);
+ return loadSomeSymbols(symtab, STB_GLOBAL, addrMask);
}
bool
ElfObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
{
- return loadSomeSymbols(symtab, STB_LOCAL);
+ return loadSomeSymbols(symtab, STB_LOCAL, addrMask);
}
bool
diff --git a/src/base/loader/elf_object.hh b/src/base/loader/elf_object.hh
index 5c5f6907d..a19e82b28 100644
--- a/src/base/loader/elf_object.hh
+++ b/src/base/loader/elf_object.hh
@@ -50,7 +50,7 @@ class ElfObject : public ObjectFile
std::set<std::string> sectionNames;
/// Helper functions for loadGlobalSymbols() and loadLocalSymbols().
- bool loadSomeSymbols(SymbolTable *symtab, int binding);
+ bool loadSomeSymbols(SymbolTable *symtab, int binding, Addr mask);
ElfObject(const std::string &_filename, int _fd,
size_t _len, uint8_t *_data,