[Scummvm-cvs-logs] SF.net SVN: scummvm:[50467] scummvm/branches/gsoc2010-plugins/backends/ platform/gp2xwiz/gp2xwiz-loader.cpp

toneman1138 at users.sourceforge.net toneman1138 at users.sourceforge.net
Tue Jun 29 01:34:07 CEST 2010


Revision: 50467
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50467&view=rev
Author:   toneman1138
Date:     2010-06-28 23:34:06 +0000 (Mon, 28 Jun 2010)

Log Message:
-----------
reimplemented DLObject::open

Modified Paths:
--------------
    scummvm/branches/gsoc2010-plugins/backends/platform/gp2xwiz/gp2xwiz-loader.cpp

Modified: scummvm/branches/gsoc2010-plugins/backends/platform/gp2xwiz/gp2xwiz-loader.cpp
===================================================================
--- scummvm/branches/gsoc2010-plugins/backends/platform/gp2xwiz/gp2xwiz-loader.cpp	2010-06-28 22:26:28 UTC (rev 50466)
+++ scummvm/branches/gsoc2010-plugins/backends/platform/gp2xwiz/gp2xwiz-loader.cpp	2010-06-28 23:34:06 UTC (rev 50467)
@@ -31,7 +31,9 @@
 #include <stdio.h>
 #include <malloc.h>
 #include <unistd.h>
+#include <sys/fcntl.h>
 
+
 #include "backends/platform/gp2xwiz/gp2xwiz-loader.h"
 
 #define __WIZ_DEBUG_PLUGINS__
@@ -91,11 +93,13 @@
 	// TODO: Loop over relocation entries
 	for (int i = 0; i < cnt; i++) {
 
+		DBG("attempting to relocate!");
+
 	    //Elf32_Sym *sym = ???;
 
 		//void *target = ???;
 
-	//	switch (/*relocation type*/) {
+		/*switch (REL_TYPE()) {*/
 		//case ??? :
 			//TODO: Cases for each relocation type.
 			//break;
@@ -113,17 +117,6 @@
 
 bool DLObject::readElfHeader(int fd, Elf32_Ehdr *ehdr) {
 
-	/*
-	if (read(fd, &ehdr, sizeof(ehdr)) != sizeof(ehdr) ||
-		memcmp(ehdr.e_ident, ELFMAG, SELFMAG) ||
-	    ehdr.e_type != 2 ||  ehdr.e_machine != 42 ||
-	    ehdr.e_phentsize < sizeof(phdr) || ehdr.e_shentsize != sizeof(*shdr) ||
-	    ehdr.e_phnum != 1) {
-	    seterror("Invalid file type.");
-	    return false;
-	}
-	*/
-
 	// Start reading the elf header. Check for errors
 	if (read(fd, ehdr, sizeof(*ehdr)) != sizeof(*ehdr) ||
 	        memcmp(ehdr->e_ident, ELFMAG, SELFMAG) ||			// Check MAGIC
@@ -377,10 +370,10 @@
 
 	DBG(("open(\"%s\")\n", path));
 
-	/*if ((fd = ::open(path, O_RDONLY)) < 0) {
+	if ((fd = ::open(path, O_RDONLY)) < 0) {
 		seterror("%s not found.", path);
 		return false;
-	} TODO: reimplement this "attempt to open" code */
+	}
 
 	// Try to load and relocate
 	if (!load(fd)) {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list