[GHC] #4213: LLVM: Add support for TNTC to LLVM compiler suite
GHC
ghc-devs at haskell.org
Fri May 23 18:44:23 UTC 2014
#4213: LLVM: Add support for TNTC to LLVM compiler suite
-------------------------------------+------------------------------------
Reporter: dterei | Owner: dterei
Type: feature request | Status: new
Priority: low | Milestone: 7.6.2
Component: Compiler (LLVM) | Version: 6.13
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by rwbarton):
If we mangle the symbol table of the output .o file then it will be too
late for intra-module references to be fixed up. So either we need to
mangle the assembly anyways, or we need to adjust the input to LLVM taking
this into account. That means when we build a thunk, we need to obtain the
pointer to the end of the info table, which will be the symbol as known by
LLVM plus some constant, but only when the symbol is in the current
module; and when we want to jump to another function we need that function
to start with one of these little jmps to skip the info table, since we
can't tell LLVM to do a jump to a symbol plus some random byte offset.
The symbol offset approach sounds workable to me.
I assume it's not possible to tell LLVM to emit a global symbol in the
middle of a function, as a second entry point? That would also solve our
problem, as we could then stick the _info symbol after the prefix data and
use it (rather than the symbol for the function, which points to the start
of the info table) for building thunks and calling as usual.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/4213#comment:17>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list