X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FLinker.c;h=dbc8599e201fe0ca68586aec1a8dc310e9c7b5ff;hb=4afc3a50c27ae4ac4bbd5a11f2f3c95bae45d778;hp=4e8bafface58501390db955f275e067f7ddb4eeb;hpb=d08e43a40133f1552ee7f4c4a9f5e3ab2d522937;p=ghc-hetmet.git diff --git a/rts/Linker.c b/rts/Linker.c index 4e8baff..dbc8599 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -136,7 +136,9 @@ static int ocVerifyImage_MachO ( ObjectCode* oc ); static int ocGetNames_MachO ( ObjectCode* oc ); static int ocResolve_MachO ( ObjectCode* oc ); +#ifndef USE_MMAP static int machoGetMisalignment( FILE * ); +#endif #if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) static int ocAllocateSymbolExtras_MachO ( ObjectCode* oc ); #endif @@ -877,7 +879,10 @@ typedef struct _RtsSymbolVal { SymI_HasProto(stable_ptr_table) \ SymI_HasProto(stackOverflow) \ SymI_HasProto(stg_CAF_BLACKHOLE_info) \ + SymI_HasProto(stg_BLACKHOLE_info) \ SymI_HasProto(__stg_EAGER_BLACKHOLE_info) \ + SymI_HasProto(stg_BLOCKING_QUEUE_CLEAN_info) \ + SymI_HasProto(stg_BLOCKING_QUEUE_DIRTY_info) \ SymI_HasProto(startTimer) \ SymI_HasProto(stg_MVAR_CLEAN_info) \ SymI_HasProto(stg_MVAR_DIRTY_info) \ @@ -941,6 +946,7 @@ typedef struct _RtsSymbolVal { SymI_HasProto(stg_sel_8_upd_info) \ SymI_HasProto(stg_sel_9_upd_info) \ SymI_HasProto(stg_upd_frame_info) \ + SymI_HasProto(stg_bh_upd_frame_info) \ SymI_HasProto(suspendThread) \ SymI_HasProto(stg_takeMVarzh) \ SymI_HasProto(stg_threadStatuszh) \ @@ -1226,11 +1232,12 @@ static OpenedDLL* opened_dlls = NULL; # if defined(OBJFORMAT_ELF) || defined(OBJFORMAT_MACHO) -static char * +static const char * internal_dlopen(const char *dll_name) { void *hdl; - char *errmsg, *errmsg_copy; + const char *errmsg; + char *errmsg_copy; // omitted: RTLD_NOW // see http://www.haskell.org/pipermail/cvs-ghc/2007-September/038570.html @@ -1270,7 +1277,7 @@ addDLL( char *dll_name ) #define NMATCH 5 regmatch_t match[NMATCH]; - char *errmsg; + const char *errmsg; FILE* fp; size_t match_length; #define MAXLINE 1000 @@ -2949,10 +2956,18 @@ ocResolve_PEi386 ( ObjectCode* oc ) #define Elf_Sym Elf64_Sym #define Elf_Rel Elf64_Rel #define Elf_Rela Elf64_Rela +#ifndef ELF_ST_TYPE #define ELF_ST_TYPE ELF64_ST_TYPE +#endif +#ifndef ELF_ST_BIND #define ELF_ST_BIND ELF64_ST_BIND +#endif +#ifndef ELF_R_TYPE #define ELF_R_TYPE ELF64_R_TYPE +#endif +#ifndef ELF_R_SYM #define ELF_R_SYM ELF64_R_SYM +#endif #else #define ELFCLASS ELFCLASS32 #define Elf_Addr Elf32_Addr @@ -4199,6 +4214,9 @@ static int relocateSection( thing += value; break; case X86_64_RELOC_SIGNED: + case X86_64_RELOC_SIGNED_1: + case X86_64_RELOC_SIGNED_2: + case X86_64_RELOC_SIGNED_4: ASSERT(reloc->r_pcrel); thing += value - baseValue; break; @@ -4781,6 +4799,7 @@ static void machoInitSymbolsWithoutUnderscore() } #endif +#ifndef USE_MMAP /* * Figure out by how much to shift the entire Mach-O file in memory * when loading so that its single segment ends up 16-byte-aligned @@ -4806,6 +4825,7 @@ static int machoGetMisalignment( FILE * f ) return misalignment ? (16 - misalignment) : 0; } +#endif #endif