src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (13)
29private sealed record BlockToRelocate(int SectionIndex, long Offset, byte[] Data, Relocation[] Relocations);
30private protected sealed record ChecksumsToCalculate(int SectionIndex, long Offset, Relocation[] ChecksumRelocations);
194adjustedAddend += Relocation.ReadValue(relocType, (void*)pData);
197if (relocType is IMAGE_REL_BASED_THUMB_BRANCH24 && !Relocation.FitsInThumb2BlRel24((int)adjustedAddend))
203Relocation.WriteValue(relocType, (void*)pData, adjustedAddend);
212long adjustedAddend = addend + Relocation.ReadValue(relocType, (void*)pData);
213Relocation.WriteValue(relocType, (void*)pData, definedSymbol.Size + adjustedAddend);
480foreach (Relocation reloc in nodeContents.Relocs)
506foreach (Relocation reloc in nodeContents.Relocs)
508RelocType fileReloc = Relocation.GetFileRelocationType(reloc.RelocType);
556ArrayBuilder<Relocation> checksumRelocationsBuilder = default;
557foreach (Relocation reloc in blockToRelocate.Relocations)
687foreach (var reloc in block.ChecksumRelocations)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (16)
572if (Relocation.GetFileRelocationType(reloc.Type) == reloc.Type)
897uint relocLength = (uint)Relocation.GetSize(reloc.Type);
902long addend = Relocation.ReadValue(reloc.Type, pData);
913Relocation.WriteValue(reloc.Type, pData, symbolImageOffset + imageBase + addend);
916Relocation.WriteValue(reloc.Type, pData, symbolImageOffset + addend);
920Relocation.WriteValue(reloc.Type, pData, symbolImageOffset - (relocOffset + relocLength) + addend);
923Relocation.WriteValue(reloc.Type, pData, (long)(symbolImageOffset & ~1u) - (long)(relocOffset + relocLength) + addend);
926Relocation.WriteValue(reloc.Type, pData, (long)symbolImageOffset - (long)relocOffset + addend);
930Relocation.WriteValue(reloc.Type, pData, fileOffset + addend);
934Relocation.WriteValue(reloc.Type, pData, symbolImageOffset - (relocOffset + offsetCorrection) + addend);
941Relocation.WriteValue(reloc.Type, pData, delta);
946Relocation.WriteValue(reloc.Type, pData, (symbolImageOffset + addend) & 0xfff);
952Relocation.WriteValue(reloc.Type, pData, delta);
962Relocation.WriteValue(reloc.Type, pData, delta);
974Span<byte> data = new byte[Relocation.GetSize(reloc.Type)];
982stream.Write(new Span<byte>(data, Relocation.GetSize(reloc.Type)));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (15)
788RelocType fileRelocType = Relocation.GetFileRelocationType(reloc.Type);
857byte[] relocScratchBuffer = new byte[Relocation.MaxSize];
874int size = Relocation.GetSize(reloc.Type);
907long addend = Relocation.ReadValue(reloc.Type, pData);
908int relocLength = Relocation.GetSize(reloc.Type);
927Relocation.WriteValue(reloc.Type, pData, symbol.Index + addend);
940Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + 0 + addend);
944Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
949Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset - (virtualRelocOffset + relocLength) + addend);
954Relocation.WriteValue(reloc.Type, pData, fileOffset + addend);
971Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
987Relocation.WriteValue(reloc.Type, pData, virtualSymbolImageOffset + addend);
994Relocation.WriteValue(reloc.Type, pData, symbol.Index + addend);
1009Span<byte> relocContents = buffer.AsSpan(0, Relocation.GetSize(reloc.Type));
1018sectionStream.Write(new Span<byte>(pData, Relocation.GetSize(reloc.Type)));