public AddDependency ( |
||
section | ||
Результат | void |
private void CreateStringSection() { stringSection.Name = ".strtab"; stringSection.Type = SectionType.StringTable; stringSection.AddressAlignment = linker.SectionAlignment; stringSection.EmitMethod = WriteStringSection; AddSection(stringSection); sectionHeaderStringSection.AddDependency(stringSection); }
protected void CreateRelocationSection(SectionKind kind, bool addend) { var relocationSection = new Section(); relocationSection.Name = (addend ? ".rela" : ".rel") + LinkerSectionNames[(int)kind]; relocationSection.Type = addend ? SectionType.RelocationA : SectionType.Relocation; relocationSection.Link = symbolSection; relocationSection.Info = GetSection(kind); relocationSection.AddressAlignment = linker.SectionAlignment; relocationSection.EntrySize = (uint)(addend ? RelocationAddendEntry.GetEntrySize(linkerFormatType) : RelocationEntry.GetEntrySize(linkerFormatType)); relocationSection.EmitMethod = WriteRelocationSection; AddSection(relocationSection); relocationSection.AddDependency(symbolSection); relocationSection.AddDependency(GetSection(kind)); }
private void CreateSymbolSection() { symbolSection.Name = ".symtab"; symbolSection.Type = SectionType.SymbolTable; symbolSection.AddressAlignment = linker.SectionAlignment; symbolSection.EntrySize = SymbolEntry.GetEntrySize(linkerFormatType); symbolSection.Link = stringSection; //symbolSection.Info = sectionHeaderStringSection; symbolSection.EmitMethod = WriteSymbolSection; AddSection(symbolSection); stringSection.AddDependency(symbolSection); sectionHeaderStringSection.AddDependency(symbolSection); }
private void CreateSections() { CreateNullSection(); Section previous = nullSection; foreach (var linkerSection in linker.LinkerSections) { if (linkerSection.Size == 0 && linkerSection.SectionKind != SectionKind.BSS) { continue; } var section = new Section() { Name = LinkerSectionNames[(int)linkerSection.SectionKind], Address = linkerSection.VirtualAddress, Offset = linkerSection.FileOffset, Size = linkerSection.AlignedSize, AddressAlignment = linkerSection.SectionAlignment, EmitMethod = WriteLinkerSection, SectionKind = linkerSection.SectionKind }; switch (linkerSection.SectionKind) { case SectionKind.Text: section.Type = SectionType.ProgBits; section.Flags = SectionAttribute.AllocExecute; break; case SectionKind.Data: section.Type = SectionType.ProgBits; section.Flags = SectionAttribute.Alloc | SectionAttribute.Write; break; case SectionKind.ROData: section.Type = SectionType.ProgBits; section.Flags = SectionAttribute.Alloc; break; case SectionKind.BSS: section.Type = SectionType.NoBits; section.Flags = SectionAttribute.Alloc | SectionAttribute.Write; break; } section.AddDependency(previous); AddSection(section); previous = section; } if (linker.EmitSymbols) { CreateSymbolSection(); CreateStringSection(); CreateRelocationSections(); } CreateSectionHeaderStringSection(); }