diff --git a/asmcomp/amd64/emit.mlp b/asmcomp/amd64/emit.mlp index 8a3e97900..046ca2a5b 100644 --- a/asmcomp/amd64/emit.mlp +++ b/asmcomp/amd64/emit.mlp @@ -848,7 +848,7 @@ let fundecl fundecl = _type (emit_symbol fundecl.fun_name) "@function"; _size (emit_symbol fundecl.fun_name) (ConstSub ( - ConstLabel ".", + ConstThis, ConstLabel (emit_symbol fundecl.fun_name))) end @@ -977,7 +977,7 @@ let end_assembly() = _long (ConstAdd ( ConstSub( ConstLabel(emit_label lbl), - ConstLabel "."), + ConstThis), const_32 ofs)) end; efa_def_label = (fun l -> _label (emit_label l)); diff --git a/asmcomp/i386/emit.mlp b/asmcomp/i386/emit.mlp index f7dd58b15..3481c3200 100644 --- a/asmcomp/i386/emit.mlp +++ b/asmcomp/i386/emit.mlp @@ -988,7 +988,7 @@ let fundecl fundecl = _type (emit_symbol fundecl.fun_name) "@function"; _size (emit_symbol fundecl.fun_name) (ConstSub ( - ConstLabel ".", + ConstThis, ConstLabel (emit_symbol fundecl.fun_name))) | _ -> () end @@ -1090,7 +1090,7 @@ let end_assembly() = efa_label_rel = (fun lbl ofs -> _long (ConstAdd ( ConstSub(ConstLabel(emit_label lbl), - ConstLabel "."), + ConstThis), const_32 ofs))); efa_def_label = (fun l -> _label (emit_label l)); efa_string = (fun s -> diff --git a/asmcomp/intel_ast.mli b/asmcomp/intel_ast.mli index 0e87d6eb3..29b35dbc5 100644 --- a/asmcomp/intel_ast.mli +++ b/asmcomp/intel_ast.mli @@ -38,6 +38,7 @@ type rounding = type constant = | Const of int64 + | ConstThis | ConstLabel of string | ConstAdd of constant * constant | ConstSub of constant * constant diff --git a/asmcomp/intel_gas.ml b/asmcomp/intel_gas.ml index 36eeb936e..989a0a15c 100644 --- a/asmcomp/intel_gas.ml +++ b/asmcomp/intel_gas.ml @@ -86,13 +86,14 @@ let bprint_arg b = function | Mem64 addr -> bprint_arg_mem b string_of_register64 addr let rec string_of_constant = function - | ConstLabel _ | Const _ as c -> string_of_simple_constant c + | ConstLabel _ | Const _ | ConstThis as c -> string_of_simple_constant c | ConstAdd (c1, c2) -> (string_of_simple_constant c1) ^ " + " ^ (string_of_simple_constant c2) | ConstSub (c1, c2) -> (string_of_simple_constant c1) ^ " - " ^ (string_of_simple_constant c2) and string_of_simple_constant = function + | ConstThis -> "." | ConstLabel l -> l | Const n when n <= 0x7FFF_FFFFL && n >= -0x8000_0000L -> Int64.to_string n | Const n -> Printf.sprintf "0x%Lx" n diff --git a/asmcomp/intel_masm.ml b/asmcomp/intel_masm.ml index 257f0e01b..243045332 100644 --- a/asmcomp/intel_masm.ml +++ b/asmcomp/intel_masm.ml @@ -83,14 +83,15 @@ let bprint_arg b arg = let rec string_of_constant = function - | ConstLabel _ | Const _ as c -> string_of_simple_constant c + | ConstLabel _ | Const _ | ConstThis as c -> string_of_simple_constant c | ConstAdd (c1, c2) -> (string_of_simple_constant c1) ^ " + " ^ (string_of_simple_constant c2) | ConstSub (c1, c2) -> (string_of_simple_constant c1) ^ " - " ^ (string_of_simple_constant c2) and string_of_simple_constant = function - | ConstLabel l -> if l = "." then "THIS BYTE" else l + | ConstThis -> "THIS BYTE" + | ConstLabel l -> l | Const n when n <= 0x7FFF_FFFFL && n >= -0x8000_0000L -> Int64.to_string n | Const n -> Printf.sprintf "0%LxH" n | ConstAdd (c1, c2) ->