Added some very pedantic warning flags
[tpg/acess2.git] / Kernel / bin / elf.c
index 4bf15fa..2f43eee 100644 (file)
@@ -2,20 +2,19 @@
  * Acess v0.1\r
  * ELF Executable Loader Code\r
  */\r
-#define DEBUG  1\r
+#define DEBUG  0\r
 #include <acess.h>\r
 #include <binary.h>\r
 #include "elf.h"\r
 \r
 #define DEBUG_WARN     1\r
 \r
-\r
 // === PROTOTYPES ===\r
 tBinary        *Elf_Load(int fp);\r
  int   Elf_Relocate(void *Base);\r
- int   Elf_GetSymbol(void *Base, char *Name, Uint *ret);\r
+ int   Elf_GetSymbol(void *Base, const char *Name, Uint *ret);\r
  int   Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symtab, Uint base);\r
-Uint   Elf_Int_HashString(char *str);\r
+Uint   Elf_Int_HashString(const char *str);\r
 \r
 // === GLOBALS ===\r
 tBinaryType    gELF_Info = {\r
@@ -286,7 +285,7 @@ int Elf_Relocate(void *Base)
        ENTER("pBase", Base);\r
        \r
        // Parse Program Header to get Dynamic Table\r
-       phtab = Base + hdr->phoff;\r
+       phtab = (void *)( (tVAddr)Base + hdr->phoff );\r
        iSegmentCount = hdr->phentcount;\r
        for(i = 0; i < iSegmentCount; i ++ )\r
        {\r
@@ -529,10 +528,10 @@ int Elf_Int_DoRelocate(Uint r_info, Uint32 *ptr, Uint32 addend, Elf32_Sym *symta
 }\r
 \r
 /**\r
- * \fn int Elf_GetSymbol(void *Base, char *name, Uint *ret)\r
+ * \fn int Elf_GetSymbol(void *Base, const char *name, Uint *ret)\r
  * \brief Get a symbol from the loaded binary\r
  */\r
-int Elf_GetSymbol(void *Base, char *Name, Uint *ret)\r
+int Elf_GetSymbol(void *Base, const char *Name, Uint *ret)\r
 {\r
        Elf32_Ehdr      *hdr = (void*)Base;\r
        Elf32_Sym       *symtab;\r
@@ -582,7 +581,7 @@ int Elf_GetSymbol(void *Base, char *Name, Uint *ret)
  * \param str  String to hash\r
  * \return Hash value\r
  */\r
-Uint Elf_Int_HashString(char *str)\r
+Uint Elf_Int_HashString(const char *str)\r
 {\r
        Uint    h = 0, g;\r
        while(*str)\r

UCC git Repository :: git.ucc.asn.au