@@ -135,7 +135,7 @@ impl<'a, 'tcx: 'a> DebugContext<'tcx> {
135
135
root. set ( gimli:: DW_AT_comp_dir , AttributeValue :: StringRef ( comp_dir) ) ;
136
136
root. set (
137
137
gimli:: DW_AT_low_pc ,
138
- AttributeValue :: Address ( Address :: Absolute ( 0 ) ) ,
138
+ AttributeValue :: Address ( Address :: Constant ( 0 ) ) ,
139
139
) ;
140
140
}
141
141
@@ -251,7 +251,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
251
251
252
252
entry. set (
253
253
gimli:: DW_AT_low_pc ,
254
- AttributeValue :: Address ( Address :: Relative { symbol, addend : 0 } ) ,
254
+ AttributeValue :: Address ( Address :: Symbol { symbol, addend : 0 } ) ,
255
255
) ;
256
256
257
257
debug_context. emit_location ( tcx, entry_id, mir. span ) ;
@@ -273,7 +273,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
273
273
) {
274
274
let line_program = & mut self . debug_context . dwarf . unit . line_program ;
275
275
276
- line_program. begin_sequence ( Some ( Address :: Relative {
276
+ line_program. begin_sequence ( Some ( Address :: Symbol {
277
277
symbol : self . symbol ,
278
278
addend : 0 ,
279
279
} ) ) ;
@@ -326,7 +326,7 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
326
326
. unit_range_list
327
327
. 0
328
328
. push ( Range :: StartLength {
329
- begin : Address :: Relative {
329
+ begin : Address :: Symbol {
330
330
symbol : self . symbol ,
331
331
addend : 0 ,
332
332
} ,
@@ -371,20 +371,22 @@ impl Writer for WriterRelocate {
371
371
372
372
fn write_address ( & mut self , address : Address , size : u8 ) -> Result < ( ) > {
373
373
match address {
374
- Address :: Absolute ( val) => self . write_word ( val, size) ,
375
- Address :: Relative { symbol, addend } => {
374
+ Address :: Constant ( val) => self . write_udata ( val, size) ,
375
+ Address :: Symbol { symbol, addend } => {
376
376
let offset = self . len ( ) as u64 ;
377
377
self . relocs . push ( DebugReloc {
378
378
offset : offset as u32 ,
379
379
size,
380
380
name : DebugRelocName :: Symbol ( symbol) ,
381
381
addend : addend as i64 ,
382
382
} ) ;
383
- self . write_word ( 0 , size)
383
+ self . write_udata ( 0 , size)
384
384
}
385
385
}
386
386
}
387
387
388
+ // TODO: implement write_eh_pointer
389
+
388
390
fn write_offset ( & mut self , val : usize , section : SectionId , size : u8 ) -> Result < ( ) > {
389
391
let offset = self . len ( ) as u32 ;
390
392
self . relocs . push ( DebugReloc {
@@ -393,7 +395,7 @@ impl Writer for WriterRelocate {
393
395
name : DebugRelocName :: Section ( section) ,
394
396
addend : val as i64 ,
395
397
} ) ;
396
- self . write_word ( 0 , size)
398
+ self . write_udata ( 0 , size)
397
399
}
398
400
399
401
fn write_offset_at (
@@ -409,6 +411,6 @@ impl Writer for WriterRelocate {
409
411
name : DebugRelocName :: Section ( section) ,
410
412
addend : val as i64 ,
411
413
} ) ;
412
- self . write_word_at ( offset, 0 , size)
414
+ self . write_udata_at ( offset, 0 , size)
413
415
}
414
416
}
0 commit comments