diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-11-13 16:07:59 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-11-13 16:08:00 -0500 |
commit | 8cb7bc5c234eb8168068f65b8888597106fec302 (patch) | |
tree | a21899d4caed0ca1e95f54036740cbf070c3d3a2 /rts | |
parent | ca1b986074757efff755c33c7f9a62c7eae43c7f (diff) | |
download | haskell-8cb7bc5c234eb8168068f65b8888597106fec302.tar.gz |
rts: Fix references to UChar
Test Plan: Validate on Windows.
Reviewers: erikd, austin, simonmar
Reviewed By: erikd
Subscribers: Phyx, thomie
Differential Revision: https://phabricator.haskell.org/D2700
Diffstat (limited to 'rts')
-rw-r--r-- | rts/LinkerInternals.h | 9 | ||||
-rw-r--r-- | rts/linker/PEi386.c | 27 |
2 files changed, 7 insertions, 29 deletions
diff --git a/rts/LinkerInternals.h b/rts/LinkerInternals.h index ce5c5ebbe4..60370bbcd2 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 56975ed976..5eaa35ad17 100644 --- a/rts/linker/PEi386.c +++ b/rts/linker/PEi386.c @@ -64,17 +64,9 @@ #include <math.h> #include <wchar.h> -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; |