diff options
author | Alain Frisch <alain@frisch.fr> | 2014-10-06 16:18:35 +0000 |
---|---|---|
committer | Alain Frisch <alain@frisch.fr> | 2014-10-06 16:18:35 +0000 |
commit | 0af5541604185d7adf27fb55e7d0df3071b01cda (patch) | |
tree | 416bb0464c423cf00995929049b880c5146fc436 /asmcomp/amd64 | |
parent | 63ee3912b3e3a0aa5bec7677d4fc07f20c1d470b (diff) | |
download | ocaml-0af5541604185d7adf27fb55e7d0df3071b01cda.tar.gz |
Fix for MacOSX.
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/abstract_intel_emit@15480 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'asmcomp/amd64')
-rw-r--r-- | asmcomp/amd64/emit.mlp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp index 6a19829c52..dae65e1f64 100644 --- a/asmcomp/amd64/emit.mlp +++ b/asmcomp/amd64/emit.mlp @@ -902,6 +902,7 @@ let end_assembly() = emit_global_label "frametable"; + let setcnt = ref 0 in emit_frames { efa_label = (fun l -> D.qword (ConstLabel (emit_label l))); efa_16 = (fun n -> D.word (const n)); @@ -909,25 +910,20 @@ let end_assembly() = efa_word = (fun n -> D.qword (const n)); efa_align = D.align; efa_label_rel = - if system = S_macosx then begin - let setcnt = ref 0 in - fun lbl ofs -> - incr setcnt; - let s = Printf.sprintf "L$set$%d" !setcnt in - D.setvar (s, - ConstAdd ( - ConstLabel(emit_label lbl), - ConstAdd (const 4, const_32 ofs)) - ); - D.long (ConstLabel s) - end else begin - fun lbl ofs -> - D.long (ConstAdd ( - ConstSub( - ConstLabel(emit_label lbl), - ConstThis), - const_32 ofs)) - end; + (fun lbl ofs -> + let c = + ConstAdd ( + ConstSub(ConstLabel(emit_label lbl), ConstThis), + const_32 ofs + ) in + if system = S_macosx then begin + incr setcnt; + let s = Printf.sprintf "L$set$%d" !setcnt in + D.setvar (s, c); + D.long (ConstLabel s) + end else + D.long c + ); efa_def_label = (fun l -> _label (emit_label l)); efa_string = (fun s -> D.bytes (s ^ "\000")) }; |