public DwarfRelocation(ulong offset, DwarfRelocationTarget target, DwarfAddressSize size, ulong addend) { Offset = offset; Target = target; Size = size; Addend = addend; }
public void WriteAddress(DwarfRelocationTarget target, ulong address) { if (EnableRelocation) { RecordRelocation(target, AddressSize, address); // If the relocation is recorded, we write 0 as an address address = 0; } WriteUInt(address); }
public void RecordRelocation(DwarfRelocationTarget target, DwarfAddressSize addressSize, ulong address) { if (CurrentSection is DwarfRelocatableSection relocSection) { relocSection.Relocations.Add(new DwarfRelocation(Offset, target, addressSize, address)); } else { throw new InvalidOperationException($"Invalid {nameof(CurrentSection)} in {nameof(DwarfWriter)}. It must be a {nameof(DwarfRelocatableSection)}."); } }