[commit: ghc] master: Final fix to #7134 (and #8717 as well.) (2b33f6e)
git at git.haskell.org
git at git.haskell.org
Tue Feb 4 11:01:02 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/2b33f6e8045fcd00f19883bb5e8895cbaf1bf81e/ghc
>---------------------------------------------------------------
commit 2b33f6e8045fcd00f19883bb5e8895cbaf1bf81e
Author: Kyrill Briantsev <kyrab at mail.ru>
Date: Tue Feb 4 05:00:33 2014 -0600
Final fix to #7134 (and #8717 as well.)
Signed-off-by: Austin Seipp <austin at well-typed.com>
>---------------------------------------------------------------
2b33f6e8045fcd00f19883bb5e8895cbaf1bf81e
rts/Linker.c | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
diff --git a/rts/Linker.c b/rts/Linker.c
index 9bb377c..b9c8fd0 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -3491,8 +3491,8 @@ allocateImageAndTrampolines (
/* For 32-bit case we don't need this, hence we use macro PEi386_IMAGE_OFFSET,
which equals to 4 for 64-bit case and 0 for 32-bit case. */
/* We allocate trampolines area for all symbols right behind
- image data, aligned on 16. */
- size = ((PEi386_IMAGE_OFFSET + size + 0xf) & ~0xf)
+ image data, aligned on 8. */
+ size = ((PEi386_IMAGE_OFFSET + size + 0x7) & ~0x7)
+ hdr.NumberOfSymbols * sizeof(SymbolExtra);
#endif
image = VirtualAlloc(NULL, size,
@@ -4147,7 +4147,7 @@ static int
ocAllocateSymbolExtras_PEi386 ( ObjectCode* oc )
{
oc->symbol_extras = (SymbolExtra*)(oc->image - PEi386_IMAGE_OFFSET
- + ((PEi386_IMAGE_OFFSET + oc->fileSize + 0xf) & ~0xf));
+ + ((PEi386_IMAGE_OFFSET + oc->fileSize + 0x7) & ~0x7));
oc->first_symbol_extra = 0;
oc->n_symbol_extras = ((COFF_header*)oc->image)->NumberOfSymbols;
@@ -4161,7 +4161,7 @@ makeSymbolExtra_PEi386( ObjectCode* oc, size_t s, char* symbol )
SymbolExtra *extra;
curr_thunk = oc->first_symbol_extra;
- if (curr_thunk > oc->n_symbol_extras) {
+ if (curr_thunk >= oc->n_symbol_extras) {
barf("Can't allocate thunk for %s", symbol);
}
@@ -4172,14 +4172,6 @@ makeSymbolExtra_PEi386( ObjectCode* oc, size_t s, char* symbol )
extra->addr = (uint64_t)s;
memcpy(extra->jumpIsland, jmp, 6);
- /* DLL-imported symbols are inserted here.
- Others are inserted in ocGetNames_PEi386.
- */
- if(lookupStrHashTable(symhash, symbol) == NULL) {
- ghciInsertSymbolTable(oc->fileName, symhash, symbol, extra->jumpIsland,
- HS_BOOL_FALSE, oc);
- }
-
oc->first_symbol_extra++;
return (size_t)extra->jumpIsland;
More information about the ghc-commits
mailing list