Write() public method

Writes the program header
public Write ( LinkerFormatType elfType, BinaryWriter writer ) : void
elfType LinkerFormatType Type of the elf.
writer System.IO.BinaryWriter The writer.
return void
コード例 #1
0
ファイル: ElfLinker.cs プロジェクト: mlintell/MOSA-Project
        protected void EmitRelocation(LinkerSection linkerSection, Section section)
        {
            int count = 0;

            foreach (var symbol in linkerSection.Symbols)
            {
                foreach (var patch in symbol.LinkRequests)
                {
                    if (patch.ReferenceOffset != 0)
                    {
                        continue;
                    }

                    if (patch.LinkType == LinkType.Size)
                    {
                        continue;
                    }

                    var relocationEntry = new RelocationEntry()
                    {
                        RelocationType = ConvertType(patch.LinkType, linker.MachineType),
                        Symbol         = symbolTableOffset[symbol],
                        Offset         = (ulong)patch.PatchOffset,
                    };

                    relocationEntry.Write(linkerFormatType, writer);
                    count++;
                }

                section.Size = (uint)(count * RelocationEntry.GetEntrySize(linkerFormatType));
            }
        }