Commit 45e70a14 authored by ian@well-typed.com's avatar ian@well-typed.com
Browse files

Merge branch 'ticket-7442' of git://github.com/phonohawk/ghc

parents 0cb35b55 2334112f
......@@ -183,10 +183,12 @@ cpsTop hsc_env proc =
-- the entry point.
splitting_proc_points = hscTarget dflags /= HscAsm
|| not (tablesNextToCode dflags)
|| usingDarwinX86Pic -- Note [darwin-x86-pic]
usingDarwinX86Pic = platformArch platform == ArchX86
&& platformOS platform == OSDarwin
&& gopt Opt_PIC dflags
|| usingInconsistentPicReg -- Note [darwin-x86-pic]
usingInconsistentPicReg = ( platformArch platform == ArchX86 ||
platformArch platform == ArchPPC
)
&& platformOS platform == OSDarwin
&& gopt Opt_PIC dflags
{- Note [darwin-x86-pic]
......@@ -205,6 +207,12 @@ points, then at the join point we don't have a consistent value for
Hence, on x86/Darwin, we have to split proc points, and then each proc
point will get its own PIC initialisation sequence.
The situation is the same for ppc/Darwin. We use essentially the same
sequence to load the program counter onto reg:
bcl 20,31,1f
1: mflr reg
This isn't an issue on x86/ELF, where the sequence is
call 1f
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment