diff options
author | Artem Pyanykh <artempyanykh@gmail.com> | 2019-02-21 12:10:38 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-03-20 19:52:39 -0400 |
commit | 368187591a5454e47c4e08dae90d39d2af1fad40 (patch) | |
tree | ce6b0c92dc5b0b9b493a33421bbe1f71ae915e6c /rts/linker/SymbolExtras.c | |
parent | 3394a7cd27cec64a577ee0a9df887a431ccb3696 (diff) | |
download | haskell-368187591a5454e47c4e08dae90d39d2af1fad40.tar.gz |
Adjust section placement and relocation logic for Mach-O
1. Place each section on a separate page to ensure required
alignment (wastes lots ot space, needs to be improved).
2. Unwire relocation logic from macho sections (the most fiddly part
is adjusting internal relocations).
Other todos:
0. Add a test for section alignment.
1. Investigate 32bit relocations!
2. Fix memory leak in ZEROPAGE section allocation.
3. Fix creating redundant jump islands for GOT.
4. Investigate more compact section placement.
Diffstat (limited to 'rts/linker/SymbolExtras.c')
-rw-r--r-- | rts/linker/SymbolExtras.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/linker/SymbolExtras.c b/rts/linker/SymbolExtras.c index a9e4c37967..4149522ba0 100644 --- a/rts/linker/SymbolExtras.c +++ b/rts/linker/SymbolExtras.c @@ -149,6 +149,7 @@ SymbolExtra* makeSymbolExtra( ObjectCode const* oc, #endif /* powerpc_HOST_ARCH */ #if defined(x86_64_HOST_ARCH) // jmp *-14(%rip) + // 0xFF 25 is opcode + ModRM of near absolute indirect jump static uint8_t jmp[] = { 0xFF, 0x25, 0xF2, 0xFF, 0xFF, 0xFF }; extra->addr = target; memcpy(extra->jumpIsland, jmp, 6); |