summaryrefslogtreecommitdiff
path: root/rts/linker/PEi386.h
diff options
context:
space:
mode:
Diffstat (limited to 'rts/linker/PEi386.h')
-rw-r--r--rts/linker/PEi386.h43
1 files changed, 35 insertions, 8 deletions
diff --git a/rts/linker/PEi386.h b/rts/linker/PEi386.h
index e84e05232a..eb5bec8b78 100644
--- a/rts/linker/PEi386.h
+++ b/rts/linker/PEi386.h
@@ -14,6 +14,8 @@
#define PEi386_IMAGE_OFFSET 0
#endif
+#define PEi386_STRTAB_OFFSET 4
+
/********************************************
* COFF/PE types
********************************************/
@@ -40,6 +42,7 @@ typedef struct _COFF_HEADER_INFO {
********************************************/
void initLinker_PEi386( void );
+void exitLinker_PEi386( void );
const char * addDLL_PEi386( pathchar *dll_name, HINSTANCE *instance );
void freePreloadObjectFile_PEi386( ObjectCode *oc );
@@ -55,15 +58,32 @@ bool ocGetNames_PEi386 ( ObjectCode* oc );
bool ocVerifyImage_PEi386 ( ObjectCode* oc );
SymbolAddr *lookupSymbol_PEi386(SymbolName *lbl);
bool ocAllocateSymbolExtras_PEi386 ( ObjectCode* oc );
-SymbolAddr *lookupSymbolInDLLs ( unsigned char *lbl );
+SymbolAddr *lookupSymbolInDLLs ( const SymbolName* lbl );
/* See Note [mingw-w64 name decoration scheme] */
-
-char *
-allocateImageAndTrampolines (
- pathchar* arch_name, char* member_name,
- FILE* f,
- int size,
- int isThin);
+/* 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.
+*/
+INLINE_HEADER unsigned char *
+myindex ( int scale, void* base, int index )
+{
+ return
+ ((unsigned char*)base) + scale * index;
+}
+pathchar* resolveSymbolAddr_PEi386 ( pathchar* buffer, int size,
+ SymbolAddr* symbol, uintptr_t* top );
+
+char *get_name_string(
+ unsigned char* name,
+ ObjectCode* oc);
+
+char* get_sym_name(
+ uint8_t* name,
+ ObjectCode* oc);
/********************************************
* COFF/PE headers
@@ -111,6 +131,13 @@ struct _IndirectAddr {
struct _IndirectAddr* next;
} IndirectAddr;
+/* Some alignment information. */
+typedef
+struct _Alignments {
+ uint32_t mask;
+ uint32_t value;
+} Alignments;
+
/* Util symbol handling functions. */
COFF_OBJ_TYPE getObjectType ( char* image, pathchar* fileName );
COFF_HEADER_INFO* getHeaderInfo ( ObjectCode* oc );