summaryrefslogtreecommitdiff
path: root/rts/Linker.c
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-04-26 16:52:44 +0100
committerIan Lynagh <igloo@earth.li>2012-04-26 16:52:44 +0100
commit1dbe6d59b621ab9bd836241d633b3a8d99812cb3 (patch)
tree6482c2019a3a85f93c9b38c0e985d77f24388692 /rts/Linker.c
parent3e314cc2060734ade9b82d4da418c119b3a05b4c (diff)
downloadhaskell-1dbe6d59b621ab9bd836241d633b3a8d99812cb3.tar.gz
Fix warnings on Win64
Mostly this meant getting pointer<->int conversions to use the right sizes. lnat is now size_t, rather than unsigned long, as that seems a better match for how it's used.
Diffstat (limited to 'rts/Linker.c')
-rw-r--r--rts/Linker.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index c983403611..6085f9ce14 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -2428,6 +2428,7 @@ addProddableBlock ( ObjectCode* oc, void* start, int size )
oc->proddables = pb;
}
+#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static void
checkProddableBlock (ObjectCode *oc, void *addr )
{
@@ -2444,6 +2445,7 @@ checkProddableBlock (ObjectCode *oc, void *addr )
}
barf("checkProddableBlock: invalid fixup in runtime linker");
}
+#endif
/* -----------------------------------------------------------------------------
* Section management.
@@ -2459,8 +2461,8 @@ addSection ( ObjectCode* oc, SectionKind kind,
s->next = oc->sections;
oc->sections = s;
- IF_DEBUG(linker, debugBelch("addSection: %p-%p (size %ld), kind %d\n",
- start, ((char*)end)-1, (long)end - (long)start + 1, kind ));
+ IF_DEBUG(linker, debugBelch("addSection: %p-%p (size %" FMT_Int "), kind %d\n",
+ start, ((char*)end)-1, (StgInt)end - (StgInt)start + 1, kind ));
}
@@ -2473,6 +2475,7 @@ addSection ( ObjectCode* oc, SectionKind kind,
*/
#if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(arm_HOST_ARCH)
+#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
/*
ocAllocateSymbolExtras
@@ -2551,6 +2554,7 @@ static int ocAllocateSymbolExtras( ObjectCode* oc, int count, int first )
return 1;
}
+#endif
#endif // defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) || defined(arm_HOST_ARCH)
#if defined(arm_HOST_ARCH)
@@ -2567,6 +2571,7 @@ ocFlushInstructionCache( ObjectCode *oc )
#endif
#if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
+#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static SymbolExtra* makeSymbolExtra( ObjectCode* oc,
unsigned long symbolNumber,
@@ -2604,6 +2609,7 @@ static SymbolExtra* makeSymbolExtra( ObjectCode* oc,
return extra;
}
+#endif
#endif // defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH)
#ifdef arm_HOST_ARCH
@@ -2887,6 +2893,7 @@ printName ( UChar* name, UChar* strtab )
}
+#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
static void
copyName ( UChar* name, UChar* strtab, UChar* dst, int dstSize )
{
@@ -2905,6 +2912,7 @@ copyName ( UChar* name, UChar* strtab, UChar* dst, int dstSize )
dst[i] = 0;
}
}
+#endif
static UChar *
@@ -2960,6 +2968,7 @@ cstring_from_section_name (UChar* name, UChar* strtab)
}
}
+#if !defined(x86_64_HOST_ARCH) || !defined(mingw32_HOST_OS)
/* Just compares the short names (first 8 chars) */
static COFF_section *
findPEi386SectionCalled ( ObjectCode* oc, UChar* name )
@@ -2988,7 +2997,7 @@ findPEi386SectionCalled ( ObjectCode* oc, UChar* name )
return NULL;
}
-
+#endif
static void
zapTrailingAtSign ( UChar* sym )
@@ -3099,9 +3108,9 @@ ocVerifyImage_PEi386 ( ObjectCode* oc )
IF_DEBUG(linker, i=1);
if (i == 0) return 1;
- debugBelch( "sectab offset = %d\n", ((UChar*)sectab) - ((UChar*)hdr) );
- debugBelch( "symtab offset = %d\n", ((UChar*)symtab) - ((UChar*)hdr) );
- debugBelch( "strtab offset = %d\n", ((UChar*)strtab) - ((UChar*)hdr) );
+ debugBelch( "sectab offset = %" FMT_Int "\n", ((UChar*)sectab) - ((UChar*)hdr) );
+ debugBelch( "symtab offset = %" FMT_Int "\n", ((UChar*)symtab) - ((UChar*)hdr) );
+ debugBelch( "strtab offset = %" FMT_Int "\n", ((UChar*)strtab) - ((UChar*)hdr) );
debugBelch("\n" );
debugBelch( "Machine: 0x%x\n", (UInt32)(hdr->Machine) );
@@ -3451,8 +3460,13 @@ ocGetNames_PEi386 ( ObjectCode* oc )
static int
-ocResolve_PEi386 ( ObjectCode* oc )
+ocResolve_PEi386 ( ObjectCode* oc
+#if !defined(i386_HOST_ARCH)
+ STG_UNUSED
+#endif
+ )
{
+#if defined(i386_HOST_ARCH)
COFF_header* hdr;
COFF_section* sectab;
COFF_symbol* symtab;
@@ -3535,7 +3549,6 @@ ocResolve_PEi386 ( ObjectCode* oc )
j = 0;
}
-
for (; j < noRelocs; j++) {
COFF_symbol* sym;
COFF_reloc* reltab_j
@@ -3627,6 +3640,9 @@ ocResolve_PEi386 ( ObjectCode* oc )
IF_DEBUG(linker, debugBelch("completed %" PATH_FMT, oc->fileName));
return 1;
+#else
+ barf("ocResolve_PEi386: Not supported on this arch");
+#endif
}
#endif /* defined(OBJFORMAT_PEi386) */