| 92 | } |
| 93 | |
| 94 | fn write_address(&mut self, address: Address, size: u8) -> WriteResult<()> { |
| 95 | match address { |
| 96 | Address::Constant(val) => self.write_udata(val, size), |
| 97 | Address::Symbol { symbol, addend } => { |
| 98 | let offset = self.len() as u32; |
| 99 | self.relocs.push(DwarfSectionReloc { |
| 100 | target: DwarfSectionRelocTarget::Func(symbol), |
| 101 | offset, |
| 102 | size, |
| 103 | addend: addend as i32, |
| 104 | }); |
| 105 | self.write_udata(addend as u64, size) |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | fn write_offset(&mut self, val: usize, section: SectionId, size: u8) -> WriteResult<()> { |
| 111 | let offset = self.len() as u32; |