summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorpixel <pixel>2004-01-26 15:31:54 +0000
committerpixel <pixel>2004-01-26 15:31:54 +0000
commitdd1a70b70cc5a4ab3a7dbeef2862d4a817fd91a7 (patch)
treec231980c6568c1a87412d6a7740025d7fce34742 /includes
parent3830a1a01fac86fea249fafc81f42b2f1e8ed1ae (diff)
Blah
Diffstat (limited to 'includes')
-rw-r--r--includes/mipsobj.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/includes/mipsobj.h b/includes/mipsobj.h
new file mode 100644
index 0000000..18ac504
--- /dev/null
+++ b/includes/mipsobj.h
@@ -0,0 +1,74 @@
+#ifndef __MIPSOBJ_H__
+#define __MIPSOBJ_H__
+
+#include <map>
+#include <Exceptions.h>
+#include <Handle.h>
+
+enum mips_reloc_t {
+ R_MIPS_26,
+ R_MIPS_32,
+ R_MIPS_HI16,
+ R_MIPS_LO16,
+};
+
+enum symbol_type_t {
+ LOCAL,
+ GLOBAL,
+ EXTERN,
+};
+
+enum section_type_t {
+ TEXT,
+ DATA,
+ BSS,
+};
+
+struct reloc_t {
+ String symbol;
+ int type;
+ Uint32 offset;
+};
+
+struct symbol_t {
+ String name;
+ String section;
+ int type;
+ Uint32 offset;
+};
+
+class section : public Base {
+ public:
+ section(const String &, int);
+ section();
+ virtual ~section();
+ void setname(const String &);
+ void settype(int);
+ void putdatas(const Uint8 *, int);
+ int gettype();
+ int getsize();
+ const Uint8 * getdatas();
+ void putreloc(const String &, int, Uint32);
+ void putreloc(const struct reloc_t &);
+ std::vector<struct reloc_t> relocs;
+ private:
+ String name;
+ int type;
+ Uint8 * datas;
+ int length;
+};
+
+class mipsobj : public Base {
+ public:
+ mipsobj();
+ virtual ~mipsobj();
+ std::map<String, section> sections;
+ std::map<String, symbol_t> symbols;
+ void loadELF(Handle *) throw (GeneralException);
+ void loadOBJ(Handle *) throw (GeneralException);
+ void loadLIB(Handle *, const String &) throw (GeneralException);
+ private:
+ bool loaded;
+};
+
+#endif