@@ -372,8 +372,6 @@ end = struct
372
372
let ins name ops = print_ins name ops |> Emitaux. emit_string
373
373
374
374
let labeled_ins lbl name ops =
375
- (* CR sspies: labelled instructions have to be in the text section, right?
376
- Perhaps we should add an assert here. *)
377
375
D. define_label lbl;
378
376
print_ins name ops |> Emitaux. emit_string
379
377
@@ -510,8 +508,6 @@ let record_frame_label live dbg =
510
508
live;
511
509
record_frame_descr ~label: lbl ~frame_size: (frame_size () )
512
510
~live_offset: ! live_offset dbg;
513
- (* CR sspies: Are we defining this in the text or data section? My guess would
514
- be text. *)
515
511
label_to_asm_label ~section: Text lbl
516
512
517
513
let record_frame live dbg =
@@ -1997,7 +1993,6 @@ let emit_instr i =
1997
1993
|];
1998
1994
DSL. ins I. BR [| DSL. emit_reg reg_tmp1 |])
1999
1995
| Lstackcheck { max_frame_size_bytes } ->
2000
- (* CR sspies: Are both of these in the text section? *)
2001
1996
let overflow = L. create Text and ret = L. create Text in
2002
1997
let threshold_offset =
2003
1998
(Domainstate. stack_ctx_words * 8 ) + Stack_check. stack_threshold_size
@@ -2064,7 +2059,7 @@ let fundecl fundecl =
2064
2059
D. align ~bytes: 8 ;
2065
2060
D. global fun_sym;
2066
2061
D. type_symbol ~ty: Function fun_sym;
2067
- D. define_function_symbol fun_sym;
2062
+ D. define_symbol_label ~section: Text fun_sym;
2068
2063
emit_debug_info fundecl.fun_dbg;
2069
2064
cfi_startproc () ;
2070
2065
let num_call_gc = num_call_gc_points fundecl.fun_body in
@@ -2102,16 +2097,15 @@ let emit_item (d : Cmm.data_item) =
2102
2097
evaluate to random other GOT entries. For the moment force all symbols
2103
2098
to be global. *)
2104
2099
D. global sym;
2105
- (* CR sspies: Are these data or function symbols? From context, I guessed
2106
- data symbols. *)
2107
- D. define_data_symbol sym
2108
- (* [Cint8] mirrors x86 with new directives *)
2100
+ D. define_symbol_label ~section: Data sym
2101
+ (* [Cint8] mirrors mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2109
2102
| Cint8 n -> D. int8 (Numbers.Int8. of_int_exn n)
2110
- (* [Cint16] mirrors x86 with new directives *)
2103
+ (* [Cint16] mirrors mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2111
2104
| Cint16 n -> D. int16 (Numbers.Int16. of_int_exn n)
2112
- (* [Cint32] mirrors x86 with new directives *)
2105
+ (* [Cint32] mirrors mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2113
2106
| Cint32 n -> D. int32 (Nativeint. to_int32 n)
2114
- (* [Cint] mirrors x86 with new directives *)
2107
+ (* CR mshinwell: Add [Targetint.of_nativeint] *)
2108
+ (* [Cint] mirrors mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2115
2109
| Cint n -> D. targetint (Targetint. of_int64 (Int64. of_nativeint n))
2116
2110
| Csingle f -> D. float32 f
2117
2111
| Cdouble f -> D. float64 f
@@ -2155,12 +2149,12 @@ let begin_assembly _unix =
2155
2149
let data_begin_sym = S. create data_begin in
2156
2150
D. data () ;
2157
2151
D. global data_begin_sym;
2158
- D. define_data_symbol data_begin_sym;
2152
+ D. define_symbol_label ~section: Data data_begin_sym;
2159
2153
let code_begin = Cmm_helpers. make_symbol " code_begin" in
2160
2154
let code_begin_sym = S. create code_begin in
2161
2155
emit_named_text_section code_begin;
2162
2156
D. global code_begin_sym;
2163
- D. define_function_symbol code_begin_sym;
2157
+ D. define_symbol_label ~section: Text code_begin_sym;
2164
2158
(* we need to pad here to avoid collision for the unwind test between the
2165
2159
code_begin symbol and the first function. (See also #4690) Alignment is
2166
2160
needed to avoid linker warnings for shared_startup__code_{begin,end} (e.g.
@@ -2177,22 +2171,21 @@ let end_assembly () =
2177
2171
let code_end_sym = S. create code_end in
2178
2172
emit_named_text_section code_end;
2179
2173
D. global code_end_sym;
2180
- D. define_function_symbol code_end_sym;
2174
+ D. define_symbol_label ~section: Text code_end_sym;
2181
2175
let data_end = Cmm_helpers. make_symbol " data_end" in
2182
2176
let data_end_sym = S. create data_end in
2183
2177
D. data () ;
2184
2178
D. int64 0L ;
2185
2179
(* PR#6329 *)
2186
2180
D. global data_end_sym;
2187
- D. define_data_symbol data_end_sym;
2181
+ D. define_symbol_label ~section: Data data_end_sym;
2188
2182
D. int64 0L ;
2189
2183
D. align ~bytes: 8 ;
2190
2184
(* #7887 *)
2191
2185
let frametable = Cmm_helpers. make_symbol " frametable" in
2192
2186
let frametable_sym = S. create frametable in
2193
- (* Unlike the name `lbl` suggests, we emit the label as a symbol here. *)
2194
2187
D. global frametable_sym;
2195
- D. define_data_symbol frametable_sym;
2188
+ D. define_symbol_label ~section: Data frametable_sym;
2196
2189
emit_frames
2197
2190
{ efa_code_label =
2198
2191
(fun lbl ->
@@ -2204,15 +2197,17 @@ let end_assembly () =
2204
2197
let lbl = label_to_asm_label ~section: Data lbl in
2205
2198
D. type_label ~ty: Object lbl;
2206
2199
D. label lbl);
2207
- (* [efa_8] is not part of x86 with new directives *)
2200
+ (* [efa_8] is not part of mshinwell/ocaml#gdb-names-gpr *)
2208
2201
efa_8 = (fun n -> D. uint8 (Numbers.Uint8. of_nonnegative_int_exn n));
2209
- (* [efa_16] mirrors x86 with new directives *)
2202
+ (* [efa_16] is [D.uint16 (Numbers.Uint16.of_int_exn n)] in
2203
+ mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2210
2204
efa_16 = (fun n -> D. uint16 (Numbers.Uint16. of_nonnegative_int_exn n));
2205
+ (* [efa_16] is [D.uint32 (Numbers.Uint32.of_int32 n)] in
2206
+ mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2211
2207
(* CR sspies: for some reason, we can get negative numbers here *)
2212
2208
efa_32 = (fun n -> D. int32 n);
2213
- (* CR sspies: Is a word supposed to mean 64-bit here, or an actual word
2214
- (i.e., processor size)? *)
2215
- (* [efa_word] mirrors x86 with new directives *)
2209
+ (* [efa_word] is [D.targetint (Targetint.of_int_exn n)] in
2210
+ mshinwell/ocaml#gdb-names-gpr x86 emitter *)
2216
2211
efa_word = (fun n -> D. targetint (Targetint. of_int_exn n));
2217
2212
efa_align = (fun n -> D. align ~bytes: n);
2218
2213
efa_label_rel =
0 commit comments