Пример #1
0
 public DwarfRelocation(ulong offset, DwarfRelocationTarget target, DwarfAddressSize size, ulong addend)
 {
     Offset = offset;
     Target = target;
     Size   = size;
     Addend = addend;
 }
Пример #2
0
 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);
 }
Пример #3
0
 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)}.");
     }
 }