summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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,