diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index ce5c5ebbe48ef4c2b9981a08342364558178e041..60370bbcd240e8a696ed5302880f61ba0ef9030d 100644 --- a/rts/LinkerInternals.h +++ b/rts/LinkerInternals.h @@ -281,16 +281,17 @@ int machoGetMisalignment( FILE * f ); arising from using normal C indexing or pointer arithmetic are just plain wrong. Sigh. */ -STATIC_INLINE UChar * +STATIC_INLINE unsigned char * myindex ( int scale, void* base, int index ) { return - ((UChar*)base) + scale * index; + ((unsigned char*)base) + scale * index; } +// Defined in linker/PEi386.c char *cstring_from_section_name( - UChar* name, - UChar* strtab); + unsigned char* name, + unsigned char* strtab); #endif /* mingw32_HOST_OS */ /* Which object file format are we targetting? */ diff --git a/rts/linker/PEi386.c b/rts/linker/PEi386.c index 56975ed9766c981a1e92a4689f8f9eb7e4a81b46..5eaa35ad179c880ec4a0391b01f8ab28630dd530 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -64,17 +64,9 @@ #include #include -static UChar *myindex( - int scale, - void* base, - int index); - static UChar *cstring_from_COFF_symbol_name( UChar* name, UChar* strtab); -static char *cstring_from_section_name( - UChar* name, - UChar* strtab); static size_t makeSymbolExtra_PEi386( ObjectCode* oc, @@ -84,6 +76,7 @@ static size_t makeSymbolExtra_PEi386( static void addDLLHandle( pathchar* dll_name, HINSTANCE instance); + static int verifyCOFFHeader( COFF_header *hdr, pathchar *filename); @@ -553,22 +546,6 @@ int checkAndLoadImportLibrary( pathchar* arch_name, char* member_name, FILE* f) return 1; } -/* We use myindex to calculate array addresses, rather than - simply doing the normal subscript thing. That's because - some of the above structs have sizes which are not - a whole number of words. GCC rounds their sizes up to a - whole number of words, which means that the address calcs - arising from using normal C indexing or pointer arithmetic - are just plain wrong. Sigh. -*/ -static UChar * -myindex ( int scale, void* base, int index ) -{ - return - ((UChar*)base) + scale * index; -} - - static void printName ( UChar* name, UChar* strtab ) { @@ -635,7 +612,7 @@ cstring_from_COFF_symbol_name ( UChar* name, UChar* strtab ) (when it is exactly 8 bytes long there's no trailing '\0'), so for consistency we *always* copy the string; the caller must free it */ -static char * +char * cstring_from_section_name (UChar* name, UChar* strtab) { char *newstr;