@@ -256,10 +256,12 @@ let emit_imp_table () =
256
256
D. qword (ConstLabel (emit_symbol s))
257
257
in
258
258
D. data () ;
259
- D. comment " relocation table start" ;
259
+ if ! Clflags. keep_asm_file && ! Flambda_backend_flags. dasm_comments
260
+ then D. comment " relocation table start" ;
260
261
D. align ~data: true 8 ;
261
262
Hashtbl. iter f imp_table;
262
- D. comment " relocation table end"
263
+ if ! Clflags. keep_asm_file && ! Flambda_backend_flags. dasm_comments
264
+ then D. comment " relocation table end"
263
265
264
266
let mem__imp s =
265
267
let imp_s = get_imp_symbol s in
@@ -2115,6 +2117,12 @@ let fundecl fundecl =
2115
2117
emit_function_type_and_size fundecl.fun_name
2116
2118
2117
2119
(* Emission of data *)
2120
+ let const_label_offset s o : X86_ast.constant =
2121
+ if Int64. equal o 0L
2122
+ then ConstLabel s
2123
+ else if Int64. compare o 0L > 0
2124
+ then ConstAdd (ConstLabel s, Const o)
2125
+ else ConstSub (ConstLabel s, Const (Int64. neg o))
2118
2126
2119
2127
let emit_item : Cmm.data_item -> unit = function
2120
2128
| Cdefine_symbol s -> (
@@ -2140,7 +2148,7 @@ let emit_item : Cmm.data_item -> unit = function
2140
2148
D. qword (ConstLabel (emit_cmm_symbol s))
2141
2149
| Csymbol_offset (s , o ) ->
2142
2150
add_used_symbol s.sym_name;
2143
- D. qword (ConstLabelOffset (emit_cmm_symbol s, o))
2151
+ D. qword (const_label_offset (emit_cmm_symbol s) ( Int64. of_int o))
2144
2152
| Cstring s -> D. bytes s
2145
2153
| Cskip n -> if n > 0 then D. space n
2146
2154
| Calign n -> D. align ~data: true n
@@ -2340,7 +2348,8 @@ let emit_probe_handler_wrapper p =
2340
2348
(* Account for the return address that is now pushed on the stack. *)
2341
2349
stack_offset := ! stack_offset + 8 ;
2342
2350
(* Emit function entry code *)
2343
- D. comment (Printf. sprintf " probe %s %s" probe_name handler_code_sym);
2351
+ if ! Clflags. keep_asm_file && ! Flambda_backend_flags. dasm_comments
2352
+ then D. comment (Printf. sprintf " probe %s %s" probe_name handler_code_sym);
2344
2353
emit_named_text_section wrap_label;
2345
2354
D. align ~data: false 16 ;
2346
2355
_label wrap_label;
0 commit comments