diff -rN -u old-ghc-upstream/rts/Linker.c new-ghc-upstream/rts/Linker.c
|
old
|
new
|
|
| 70 | 70 | #include <sys/wait.h> |
| 71 | 71 | #endif |
| 72 | 72 | |
| 73 | | #if defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \ |
| 74 | | defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \ |
| 75 | | defined(openbsd_HOST_OS ) || \ |
| 76 | | ( defined(darwin_HOST_OS ) && !defined(powerpc_HOST_ARCH) ) || \ |
| 77 | | defined(kfreebsdgnu_HOST_OS) |
| 78 | | /* Don't use mmap on powerpc-apple-darwin as mmap doesn't support |
| | 73 | #if !defined(powerpc_HOST_ARCH) && \ |
| | 74 | ( defined(linux_HOST_OS ) || defined(freebsd_HOST_OS) || \ |
| | 75 | defined(dragonfly_HOST_OS) || defined(netbsd_HOST_OS ) || \ |
| | 76 | defined(openbsd_HOST_OS ) || defined(darwin_HOST_OS ) || \ |
| | 77 | defined(kfreebsdgnu_HOST_OS) ) |
| | 78 | /* Don't use mmap on powerpc_HOST_ARCH as mmap doesn't support |
| 79 | 79 | * reallocating but we need to allocate jump islands just after each |
| 80 | 80 | * object images. Otherwise relative branches to jump islands can fail |
| 81 | 81 | * due to 24-bits displacement overflow. |
| … |
… |
|
| 132 | 132 | static ObjectCode* mkOc( char *path, char *image, int imageSize, |
| 133 | 133 | char *archiveMemberName |
| 134 | 134 | #ifndef USE_MMAP |
| 135 | | #ifdef darwin_HOST_OS |
| | 135 | #ifdef powerpc_HOST_ARCH |
| 136 | 136 | , int misalignment |
| 137 | 137 | #endif |
| 138 | 138 | #endif |
| … |
… |
|
| 156 | 156 | static int ocGetNames_MachO ( ObjectCode* oc ); |
| 157 | 157 | static int ocResolve_MachO ( ObjectCode* oc ); |
| 158 | 158 | |
| 159 | | #ifndef USE_MMAP |
| | 159 | #if !defined USE_MMAP && defined(darwin_HOST_OS) |
| 160 | 160 | static int machoGetMisalignment( FILE * ); |
| 161 | 161 | #endif |
| 162 | 162 | #if defined(powerpc_HOST_ARCH) || defined(x86_64_HOST_ARCH) |
| … |
… |
|
| 981 | 981 | SymI_HasProto(stg_yieldzh) \ |
| 982 | 982 | SymI_NeedsProto(stg_interp_constr_entry) \ |
| 983 | 983 | SymI_HasProto(stg_arg_bitmaps) \ |
| 984 | | SymI_HasProto(large_alloc_lim) \ |
| | 984 | SymI_HasProto(alloc_blocks_lim) \ |
| 985 | 985 | SymI_HasProto(g0) \ |
| 986 | 986 | SymI_HasProto(allocate) \ |
| 987 | 987 | SymI_HasProto(allocateExec) \ |
| … |
… |
|
| 1591 | 1591 | } else { |
| 1592 | 1592 | if ((W_)result > 0x80000000) { |
| 1593 | 1593 | // oops, we were given memory over 2Gb |
| 1594 | | #if defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) |
| | 1594 | #if defined(freebsd_HOST_OS) || defined(kfreebsdgnu_HOST_OS) || defined(dragonfly_HOST_OS) |
| 1595 | 1595 | // Some platforms require MAP_FIXED. This is normally |
| 1596 | 1596 | // a bad idea, because MAP_FIXED will overwrite |
| 1597 | 1597 | // existing mappings. |
| … |
… |
|
| 1630 | 1630 | mkOc( char *path, char *image, int imageSize, |
| 1631 | 1631 | char *archiveMemberName |
| 1632 | 1632 | #ifndef USE_MMAP |
| 1633 | | #ifdef darwin_HOST_OS |
| | 1633 | #ifdef powerpc_HOST_ARCH |
| 1634 | 1634 | , int misalignment |
| 1635 | 1635 | #endif |
| 1636 | 1636 | #endif |
| … |
… |
|
| 1669 | 1669 | oc->proddables = NULL; |
| 1670 | 1670 | |
| 1671 | 1671 | #ifndef USE_MMAP |
| 1672 | | #ifdef darwin_HOST_OS |
| | 1672 | #ifdef powerpc_HOST_ARCH |
| 1673 | 1673 | oc->misalignment = misalignment; |
| 1674 | 1674 | #endif |
| 1675 | 1675 | #endif |
| … |
… |
|
| 1696 | 1696 | char tmp[12]; |
| 1697 | 1697 | char *gnuFileIndex; |
| 1698 | 1698 | int gnuFileIndexSize; |
| 1699 | | #if !defined(USE_MMAP) && defined(darwin_HOST_OS) |
| | 1699 | #if !defined(USE_MMAP) && defined(powerpc_HOST_ARCH) |
| 1700 | 1700 | int misalignment; |
| 1701 | 1701 | #endif |
| 1702 | 1702 | |
| … |
… |
|
| 1890 | 1890 | |
| 1891 | 1891 | oc = mkOc(path, image, memberSize, archiveMemberName |
| 1892 | 1892 | #ifndef USE_MMAP |
| 1893 | | #ifdef darwin_HOST_OS |
| | 1893 | #ifdef powerpc_HOST_ARCH |
| 1894 | 1894 | , misalignment |
| 1895 | 1895 | #endif |
| 1896 | 1896 | #endif |
| … |
… |
|
| 1971 | 1971 | int fd; |
| 1972 | 1972 | #else |
| 1973 | 1973 | FILE *f; |
| 1974 | | # if defined(darwin_HOST_OS) |
| | 1974 | # if defined(powerpc_HOST_ARCH) |
| 1975 | 1975 | int misalignment; |
| 1976 | 1976 | # endif |
| 1977 | 1977 | #endif |
| … |
… |
|
| 2065 | 2065 | |
| 2066 | 2066 | oc = mkOc(path, image, fileSize, NULL |
| 2067 | 2067 | #ifndef USE_MMAP |
| 2068 | | #ifdef darwin_HOST_OS |
| | 2068 | #ifdef powerpc_HOST_ARCH |
| 2069 | 2069 | , misalignment |
| 2070 | 2070 | #endif |
| 2071 | 2071 | #endif |
| … |
… |
|
| 2315 | 2315 | int aligned; |
| 2316 | 2316 | #ifndef USE_MMAP |
| 2317 | 2317 | int misalignment = 0; |
| 2318 | | #ifdef darwin_HOST_OS |
| | 2318 | #ifdef powerpc_HOST_ARCH |
| 2319 | 2319 | misalignment = oc->misalignment; |
| 2320 | 2320 | #endif |
| 2321 | 2321 | #endif |
| … |
… |
|
| 5344 | 5344 | } |
| 5345 | 5345 | #endif |
| 5346 | 5346 | |
| 5347 | | #ifndef USE_MMAP |
| | 5347 | #if !defined USE_MMAP && defined(darwin_HOST_OS) |
| 5348 | 5348 | /* |
| 5349 | 5349 | * Figure out by how much to shift the entire Mach-O file in memory |
| 5350 | 5350 | * when loading so that its single segment ends up 16-byte-aligned |
diff -rN -u old-ghc-upstream/rts/LinkerInternals.h new-ghc-upstream/rts/LinkerInternals.h
|
old
|
new
|
|
| 80 | 80 | /* ptr to malloc'd lump of memory holding the obj file */ |
| 81 | 81 | char* image; |
| 82 | 82 | |
| 83 | | #ifdef darwin_HOST_OS |
| | 83 | #ifdef powerpc_HOST_ARCH |
| 84 | 84 | /* record by how much image has been deliberately misaligned |
| 85 | 85 | after allocation, so that we can use realloc */ |
| 86 | 86 | int misalignment; |