src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (12)
29private sealed record BlockToRelocate(int SectionIndex, long Offset, byte[] Data, Relocation[] Relocations);
30private protected sealed record ChecksumsToCalculate(int SectionIndex, long Offset, Relocation[] ChecksumRelocations);
195adjustedAddend += Relocation.ReadValue(relocType, (void*)pData);
198if (relocType is IMAGE_REL_BASED_THUMB_BRANCH24 && !Relocation.FitsInThumb2BlRel24((int)adjustedAddend))
204Relocation.WriteValue(relocType, (void*)pData, adjustedAddend);
213Relocation.WriteValue(relocType, (void*)pData, definedSymbol.Size);
483foreach (Relocation reloc in nodeContents.Relocs)
509foreach (Relocation reloc in nodeContents.Relocs)
511RelocType fileReloc = Relocation.GetFileRelocationType(reloc.RelocType);
559ArrayBuilder<Relocation> checksumRelocationsBuilder = default;
560foreach (Relocation reloc in blockToRelocate.Relocations)
685foreach (var reloc in block.ChecksumRelocations)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (14)
573if (Relocation.GetFileRelocationType(reloc.Type) == reloc.Type)
890uint relocLength = (uint)Relocation.GetSize(reloc.Type);
895long addend = Relocation.ReadValue(reloc.Type, pData);
906Relocation.WriteValue(reloc.Type, pData, symbolImageOffset + imageBase + addend);
909Relocation.WriteValue(reloc.Type, pData, symbolImageOffset + addend);
913Relocation.WriteValue(reloc.Type, pData, symbolImageOffset - (relocOffset + relocLength) + addend);
917Relocation.WriteValue(reloc.Type, pData, fileOffset + addend);
921Relocation.WriteValue(reloc.Type, pData, symbolImageOffset - (relocOffset + offsetCorrection) + addend);
928Relocation.WriteValue(reloc.Type, pData, delta);
933Relocation.WriteValue(reloc.Type, pData, (symbolImageOffset + addend) & 0xfff);
939Relocation.WriteValue(reloc.Type, pData, delta);
949Relocation.WriteValue(reloc.Type, pData, delta);
961Span<byte> data = new byte[Relocation.GetSize(reloc.Type)];
969stream.Write(new Span<byte>(data, Relocation.GetSize(reloc.Type)));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (24)
779RelocType fileRelocType = Relocation.GetFileRelocationType(reloc.Type);
829byte[] relocScratchBuffer = new byte[Relocation.MaxSize];
846int size = Relocation.GetSize(reloc.Type);
879long addend = Relocation.ReadValue(reloc.Type, pData);
880int relocLength = Relocation.GetSize(reloc.Type);
888Relocation.WriteValue(reloc.Type, pData, index);
910Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + 0 + addend);
914Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
919Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset - (virtualRelocOffset + relocLength) + addend);
925Relocation.WriteValue(reloc.Type, pData, fileOffset + addend);
942Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
958Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
972Relocation.WriteValue(reloc.Type, pData, index);
982Relocation.WriteValue(reloc.Type, pData, index);
997Span<byte> relocContents = buffer.AsSpan(0, Relocation.GetSize(reloc.Type));
1006sectionStream.Write(new Span<byte>(pData, Relocation.GetSize(reloc.Type)));
1240uint encodeLength = Relocation.WASM_PADDED_RELOC_SIZE_32;
1244Debug.Assert(headerBuffer.Slice(1).Length == Relocation.WASM_PADDED_RELOC_SIZE_32);
1251public override int HeaderSize => 1 + Relocation.WASM_PADDED_RELOC_SIZE_32;
1331Relocation.WASM_PADDED_RELOC_SIZE_32, // encode size of data length
1334Relocation.WASM_PADDED_RELOC_SIZE_32, // encode size of data length
1374Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32);
1383Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32, $"{headerBuffer.Slice(len).Length} != {Relocation.WASM_PADDED_RELOC_SIZE_32}");