summaryrefslogtreecommitdiff
path: root/src/base/loader
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/loader')
-rw-r--r--src/base/loader/aout_object.cc4
-rw-r--r--src/base/loader/aout_object.hh6
-rw-r--r--src/base/loader/ecoff_object.cc4
-rw-r--r--src/base/loader/ecoff_object.hh6
-rw-r--r--src/base/loader/elf_object.cc4
-rw-r--r--src/base/loader/elf_object.hh6
-rw-r--r--src/base/loader/object_file.hh6
-rw-r--r--src/base/loader/raw_object.cc8
-rw-r--r--src/base/loader/raw_object.hh6
9 files changed, 30 insertions, 20 deletions
diff --git a/src/base/loader/aout_object.cc b/src/base/loader/aout_object.cc
index 6691bd4ae..8fbad8030 100644
--- a/src/base/loader/aout_object.cc
+++ b/src/base/loader/aout_object.cc
@@ -82,14 +82,14 @@ AoutObject::AoutObject(const string &_filename, int _fd,
bool
-AoutObject::loadGlobalSymbols(SymbolTable *symtab)
+AoutObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{
// a.out symbols not supported yet
return false;
}
bool
-AoutObject::loadLocalSymbols(SymbolTable *symtab)
+AoutObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
{
// a.out symbols not supported yet
return false;
diff --git a/src/base/loader/aout_object.hh b/src/base/loader/aout_object.hh
index d180d69f3..7bac5be65 100644
--- a/src/base/loader/aout_object.hh
+++ b/src/base/loader/aout_object.hh
@@ -48,8 +48,10 @@ class AoutObject : public ObjectFile
public:
virtual ~AoutObject() {}
- virtual bool loadGlobalSymbols(SymbolTable *symtab);
- virtual bool loadLocalSymbols(SymbolTable *symtab);
+ virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
+ virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
static ObjectFile *tryFile(const std::string &fname, int fd,
size_t len, uint8_t *data);
diff --git a/src/base/loader/ecoff_object.cc b/src/base/loader/ecoff_object.cc
index 134f2d98d..a5a0ad9a4 100644
--- a/src/base/loader/ecoff_object.cc
+++ b/src/base/loader/ecoff_object.cc
@@ -86,7 +86,7 @@ EcoffObject::EcoffObject(const string &_filename, int _fd,
bool
-EcoffObject::loadGlobalSymbols(SymbolTable *symtab)
+EcoffObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{
if (!symtab)
return false;
@@ -115,7 +115,7 @@ EcoffObject::loadGlobalSymbols(SymbolTable *symtab)
}
bool
-EcoffObject::loadLocalSymbols(SymbolTable *symtab)
+EcoffObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
{
if (!symtab)
return false;
diff --git a/src/base/loader/ecoff_object.hh b/src/base/loader/ecoff_object.hh
index 05c604b2b..ca6fa2dd0 100644
--- a/src/base/loader/ecoff_object.hh
+++ b/src/base/loader/ecoff_object.hh
@@ -52,8 +52,10 @@ class EcoffObject : public ObjectFile
public:
virtual ~EcoffObject() {}
- virtual bool loadGlobalSymbols(SymbolTable *symtab);
- virtual bool loadLocalSymbols(SymbolTable *symtab);
+ virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
+ virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
static ObjectFile *tryFile(const std::string &fname, int fd,
size_t len, uint8_t *data);
diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc
index 2ca0d4f4a..7339507f6 100644
--- a/src/base/loader/elf_object.cc
+++ b/src/base/loader/elf_object.cc
@@ -330,13 +330,13 @@ ElfObject::loadSomeSymbols(SymbolTable *symtab, int binding)
}
bool
-ElfObject::loadGlobalSymbols(SymbolTable *symtab)
+ElfObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{
return loadSomeSymbols(symtab, STB_GLOBAL);
}
bool
-ElfObject::loadLocalSymbols(SymbolTable *symtab)
+ElfObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
{
return loadSomeSymbols(symtab, STB_LOCAL);
}
diff --git a/src/base/loader/elf_object.hh b/src/base/loader/elf_object.hh
index 9755426b4..fb728b3c5 100644
--- a/src/base/loader/elf_object.hh
+++ b/src/base/loader/elf_object.hh
@@ -53,8 +53,10 @@ class ElfObject : public ObjectFile
public:
virtual ~ElfObject() {}
- virtual bool loadGlobalSymbols(SymbolTable *symtab);
- virtual bool loadLocalSymbols(SymbolTable *symtab);
+ virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
+ virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
static ObjectFile *tryFile(const std::string &fname, int fd,
size_t len, uint8_t *data);
diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh
index 64085185d..6e98332c5 100644
--- a/src/base/loader/object_file.hh
+++ b/src/base/loader/object_file.hh
@@ -78,8 +78,10 @@ class ObjectFile
virtual bool loadSections(Port *memPort, Addr addrMask =
std::numeric_limits<Addr>::max());
- virtual bool loadGlobalSymbols(SymbolTable *symtab) = 0;
- virtual bool loadLocalSymbols(SymbolTable *symtab) = 0;
+ virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max()) = 0;
+ virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max()) = 0;
Arch getArch() const { return arch; }
OpSys getOpSys() const { return opSys; }
diff --git a/src/base/loader/raw_object.cc b/src/base/loader/raw_object.cc
index 1faf33426..2a52b0d6e 100644
--- a/src/base/loader/raw_object.cc
+++ b/src/base/loader/raw_object.cc
@@ -61,21 +61,21 @@ RawObject::RawObject(const std::string &_filename, int _fd, size_t _len,
}
bool
-RawObject::loadGlobalSymbols(SymbolTable *symtab)
+RawObject::loadGlobalSymbols(SymbolTable *symtab, Addr addrMask)
{
int fnameStart = filename.rfind('/',filename.size()) + 1;
int extStart = filename.rfind('.',filename.size());
- symtab->insert(text.baseAddr, filename.substr(fnameStart,
+ symtab->insert(text.baseAddr & addrMask, filename.substr(fnameStart,
extStart-fnameStart) + "_start");
return true;
}
bool
-RawObject::loadLocalSymbols(SymbolTable *symtab)
+RawObject::loadLocalSymbols(SymbolTable *symtab, Addr addrMask)
{
int fnameStart = filename.rfind('/',filename.size()) + 1;
int extStart = filename.rfind('.',filename.size());
- symtab->insert(text.baseAddr, filename.substr(fnameStart,
+ symtab->insert(text.baseAddr & addrMask, filename.substr(fnameStart,
extStart-fnameStart) + "_start");
return true;
}
diff --git a/src/base/loader/raw_object.hh b/src/base/loader/raw_object.hh
index c7fff4e66..9014a2d30 100644
--- a/src/base/loader/raw_object.hh
+++ b/src/base/loader/raw_object.hh
@@ -41,8 +41,10 @@ class RawObject: public ObjectFile
public:
virtual ~RawObject() {}
- virtual bool loadGlobalSymbols(SymbolTable *symtab);
- virtual bool loadLocalSymbols(SymbolTable *symtab);
+ virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
+ virtual bool loadLocalSymbols(SymbolTable *symtab, Addr addrMask =
+ std::numeric_limits<Addr>::max());
static ObjectFile *tryFile(const std::string &fname, int fd, size_t len,
uint8_t *data);