diff options
author | Tony Puccinelli | 2010-06-18 00:18:26 +0000 |
---|---|---|
committer | Tony Puccinelli | 2010-06-18 00:18:26 +0000 |
commit | 1d714c0694eaf7ac7290eab93f6f99e67439ca6b (patch) | |
tree | 0efc8c3201ba6f57a81a59b5ff8349fcf986d2c4 /backends/platform/gp2xwiz/gp2xwiz-loader.h | |
parent | 57430e725da6416fb97eab3ce4d68b85b02e0e64 (diff) | |
download | scummvm-rg350-1d714c0694eaf7ac7290eab93f6f99e67439ca6b.tar.gz scummvm-rg350-1d714c0694eaf7ac7290eab93f6f99e67439ca6b.tar.bz2 scummvm-rg350-1d714c0694eaf7ac7290eab93f6f99e67439ca6b.zip |
added ELF loader header for gp2xwiz
svn-id: r49977
Diffstat (limited to 'backends/platform/gp2xwiz/gp2xwiz-loader.h')
-rw-r--r-- | backends/platform/gp2xwiz/gp2xwiz-loader.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/backends/platform/gp2xwiz/gp2xwiz-loader.h b/backends/platform/gp2xwiz/gp2xwiz-loader.h new file mode 100644 index 0000000000..066fc4d71d --- /dev/null +++ b/backends/platform/gp2xwiz/gp2xwiz-loader.h @@ -0,0 +1,67 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#ifndef GP2XWIZ_LOADER_H +#define GP2XWIZ_LOADER_H + +#include "elf32.h" + +#define MAXDLERRLEN 80 + +class DLObject { + protected: + char *errbuf; /* For error messages, at least MAXDLERRLEN in size */ + + void *_segment, *_symtab; + char *_strtab; + int _symbol_cnt; + void *_dtors_start, *_dtors_end; + + void seterror(const char *fmt, ...); + void unload(); + bool relocate(int fd, unsigned long offset, unsigned long size); + bool load(int fd); + + public: + bool open(const char *path); + bool close(); + void *symbol(const char *name); + void discard_symtab(); + + DLObject(char *errbuf = NULL) : errbuf(_errbuf), _segment(NULL),_symtab(NULL), + _strtab(NULL), _symbol_cnt(0), _dtors_start(NULL), _dtors_end(NULL) {} +}; + +#define RTLD_LAZY 0 + +extern "C" { + void *dlopen(const char *filename, int flags); + int dlclose(void *handle); + void *dlsym(void *handle, const char *symbol); + const char *dlerror(); + void dlforgetsyms(void *handle); +} + +#endif /* GP2XWIZ_LOADER_H */ |