diff options
author | Steve Reinhardt <stever@eecs.umich.edu> | 2004-01-14 22:30:16 -0800 |
---|---|---|
committer | Steve Reinhardt <stever@eecs.umich.edu> | 2004-01-14 22:30:16 -0800 |
commit | 9f2aae4e28625cee89a13115347aca37474c7f44 (patch) | |
tree | e72a0affaf64e8a52ee0a737b1581e5f961833aa /base/loader/elf_object.hh | |
parent | fe32fdece25f9adad90e74b5984e26d36cf27f31 (diff) | |
download | gem5-9f2aae4e28625cee89a13115347aca37474c7f44.tar.xz |
Fixes and cleanup to elf loader code.
base/loader/elf_object.cc:
- Use program header instead of section headers for loading.
The old code doesn't work for Alpha/Linux user binaries.
- Deal properly with single-segment ELF executables (e.g. kernels)...
haven't tested this but it looks like it matches the functionality
of the patch the L4::Pistachio guys sent.
- Factor load symbol code into one common function.
- Some formatting to match style conventions.
- Only include libelf stuff in .cc file, not .hh.
base/loader/elf_object.hh:
- Use program header instead of section headers for loading.
The old code doesn't work for Alpha/Linux user binaries.
- Factor load symbol code into one common function.
- Only include libelf stuff in .cc file, not .hh.
--HG--
extra : convert_revision : 782062d09d43083b01e65cd645c941f49c27640a
Diffstat (limited to 'base/loader/elf_object.hh')
-rw-r--r-- | base/loader/elf_object.hh | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/base/loader/elf_object.hh b/base/loader/elf_object.hh index 9f0385d86..35a6c6d6e 100644 --- a/base/loader/elf_object.hh +++ b/base/loader/elf_object.hh @@ -29,19 +29,18 @@ #ifndef __ELF_OBJECT_HH__ #define __ELF_OBJECT_HH__ -/* Because of the -Wundef flag we have to do this */ -#define __LIBELF_INTERNAL__ 0 -#define __LIBELF64_LINUX 1 -#define __LIBELF_NEED_LINK_H 0 - -#include <libelf/libelf.h> -#include <libelf/gelf.h> #include "base/loader/object_file.hh" class ElfObject : public ObjectFile { protected: + uint8_t *fileTextBits; //!< Pointer to file's text segment image + uint8_t *fileDataBits; //!< Pointer to file's data segment image + + /// Helper functions for loadGlobalSymbols() and loadLocalSymbols(). + bool loadSomeSymbols(SymbolTable *symtab, int binding); + ElfObject(const std::string &_filename, int _fd, size_t _len, uint8_t *_data, Arch _arch, OpSys _opSys); |