22 #ifndef BACKENDS_PLUGINS_ELF_LOADER_H 23 #define BACKENDS_PLUGINS_ELF_LOADER_H 25 #include "common/scummsys.h" 27 #if defined(DYNAMIC_MODULES) && defined(USE_ELF_LOADER) 31 #include "backends/plugins/elf/elf32.h" 32 #include "backends/plugins/dynamic-plugin.h" 34 #include "common/stream.h" 52 ptrdiff_t _segmentOffset;
57 void *_dtors_start, *_dtors_end;
59 virtual void unload();
62 bool readElfHeader(Elf32_Ehdr *ehdr);
63 bool readProgramHeaders(Elf32_Ehdr *ehdr, Elf32_Phdr *phdr, Elf32_Half num);
64 virtual bool loadSegment(Elf32_Phdr *phdr);
65 Elf32_Shdr *loadSectionHeaders(Elf32_Ehdr *ehdr);
66 int findSymbolTableSection(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr);
67 int loadSymbolTable(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr);
68 bool loadStringTable(Elf32_Shdr *shdr);
69 virtual void relocateSymbols(ptrdiff_t offset);
70 void discardSegment();
81 virtual bool relocate(Elf32_Off offset, Elf32_Word size, byte *relSegment) = 0;
82 virtual bool relocateRels(Elf32_Ehdr *ehdr, Elf32_Shdr *shdr) = 0;
85 virtual void flushDataCache(
void *ptr, uint32 len)
const = 0;
86 virtual void *allocateMemory(uint32 align, uint32 size);
87 virtual void deallocateMemory(
void *ptr, uint32 size);
88 virtual void protectMemory(
void *ptr, uint32 len,
int prot)
const {};
101 void *symbol(
const char *name);
102 void discardSymtab();
Definition: dcloader.h:29