diff options
| author | Andre Heider | 2010-09-05 12:38:58 +0000 |
|---|---|---|
| committer | Andre Heider | 2010-09-05 12:38:58 +0000 |
| commit | c5a189f4d5f5a9f94b7e063077ba0ee5aaf1a788 (patch) | |
| tree | 2d6038c0230e8a5ddb238bf61631aebbb726ee07 /backends/plugins/elf-loader.h | |
| parent | ee2f4ef18963c4f3339a3cbdd5424fc0f36661c0 (diff) | |
| download | scummvm-rg350-c5a189f4d5f5a9f94b7e063077ba0ee5aaf1a788.tar.gz scummvm-rg350-c5a189f4d5f5a9f94b7e063077ba0ee5aaf1a788.tar.bz2 scummvm-rg350-c5a189f4d5f5a9f94b7e063077ba0ee5aaf1a788.zip | |
PLUGINS: Respect the VMA when relocating.
Plugins do not have to be linked at 0x0. Some platforms have limited
relocation jump offsets, which makes 0x0 unusable.
svn-id: r52551
Diffstat (limited to 'backends/plugins/elf-loader.h')
| -rw-r--r-- | backends/plugins/elf-loader.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/backends/plugins/elf-loader.h b/backends/plugins/elf-loader.h index 93a6a15309..8d974eccb7 100644 --- a/backends/plugins/elf-loader.h +++ b/backends/plugins/elf-loader.h @@ -28,6 +28,8 @@ #ifndef ELF_LOADER_H #define ELF_LOADER_H +#include <stddef.h> + #include "backends/plugins/dynamic-plugin.h" #include "backends/plugins/elf32.h" @@ -49,6 +51,7 @@ protected: void *_dtors_start, *_dtors_end; uint32 _segmentSize; + ptrdiff_t _segmentOffset; virtual void unload(); virtual bool relocate(Common::SeekableReadStream* DLFile, unsigned long offset, unsigned long size, void *relSegment) = 0; @@ -60,7 +63,7 @@ protected: Elf32_Shdr *loadSectionHeaders(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr); int loadSymbolTable(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr); bool loadStringTable(Common::SeekableReadStream* DLFile, Elf32_Shdr *shdr); - virtual void relocateSymbols(Elf32_Addr offset); + virtual void relocateSymbols(ptrdiff_t offset); virtual bool relocateRels(Common::SeekableReadStream* DLFile, Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) = 0; public: @@ -69,9 +72,8 @@ public: void *symbol(const char *name); void discard_symtab(); - DLObject() : _segment(NULL), _symtab(NULL), _strtab(NULL), _symbol_cnt(0), - _symtab_sect(-1), _dtors_start(NULL), _dtors_end(NULL), _segmentSize(0) {} - virtual ~DLObject() { unload(); } + DLObject(); + virtual ~DLObject(); }; #endif /* ELF_LOADER_H */ |
