本文整理汇总了C#中SectionKind类的典型用法代码示例。如果您正苦于以下问题:C# SectionKind类的具体用法?C# SectionKind怎么用?C# SectionKind使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SectionKind类属于命名空间,在下文中一共展示了SectionKind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Elf32Section
/// <summary>
/// Initializes a new instance of the <see cref="Elf32Section"/> class.
/// </summary>
/// <param name="kind">The kind of the section.</param>
/// <param name="name">The name.</param>
/// <param name="virtualAddress">The virtualAddress.</param>
public Elf32Section(SectionKind kind, string name, IntPtr virtualAddress)
: base(kind, name, virtualAddress)
{
_header = new Elf32SectionHeader();
_header.Name = Elf32StringTableSection.AddString(name);
_sectionStream = new System.IO.MemoryStream();
}
示例2: LinkerSymbol
internal LinkerSymbol(string name, SectionKind kind, uint alignment)
{
Name = name;
Alignment = alignment;
SectionKind = kind;
LinkRequests = new List<LinkRequest>();
}
示例3: Section
/// <summary>
/// Initializes a new instance of the <see cref="Section"/> class.
/// </summary>
/// <param name="kind">The kind of the section.</param>
/// <param name="name">The name.</param>
/// <param name="virtualAddress">The virtualAddress.</param>
public Section(SectionKind kind, string name, IntPtr virtualAddress)
: base(kind, name, virtualAddress)
{
header = new SectionHeader();
header.Name = StringTableSection.AddString(name);
stream = new MemoryStream();
}
示例4: LinkerSection
public LinkerSection(SectionKind sectionKind, uint alignment)
{
SectionKind = sectionKind;
IsResolved = false;
symbolLookup = new Dictionary<string, LinkerSymbol>();
Symbols = new List<LinkerSymbol>();
SectionAlignment = alignment;
Size = 0;
}
示例5: SimLinkerSection
/// <summary>
/// Initializes a new instance of the <see cref="SimLinkerSection" /> class.
/// </summary>
/// <param name="kind">The kind of the section.</param>
/// <param name="name">The name.</param>
/// <param name="address">The address.</param>
/// <param name="size">The size.</param>
/// <param name="simAdapter">The sim adapter.</param>
public SimLinkerSection(SectionKind kind, string name, uint address, uint size, ISimAdapter simAdapter)
: base(kind, name, 0)
{
Memory = new byte[size];
VirtualAddress = address;
simAdapter.SimCPU.AddMemory(address, size, 1);
stream = new MemoryStream(Memory, true);
}
示例6: LinkerSymbol
/// <summary>
/// Initializes a new instance of the <see cref="LinkerSymbol"/> class.
/// </summary>
/// <param name="name">The name of the symbol.</param>
/// <param name="section">The section holding the symbol.</param>
/// <param name="sectionAddress">Holds the section relative address of the symbol.</param>
/// <exception cref="T:System.ArgumentException"><paramref name="name"/> is empty.</exception>
/// <exception cref="T:System.ArgumentNullException"><paramref name="name"/> is null.</exception>
public LinkerSymbol(string name, SectionKind section, long sectionAddress)
{
Debug.Assert(!String.IsNullOrEmpty(name), @"LinkerSymbol requires a proper name.");
if (name == null)
throw new ArgumentNullException(@"name");
if (name.Length == 0)
throw new ArgumentException(@"Name can't be empty.", @"name");
this.name = name;
this.section = section;
this.sectionAddress = sectionAddress;
}
示例7: AllocateSpace
private void AllocateSpace(RuntimeField field, SectionKind section, int size, int alignment)
{
using (Stream stream = linker.Allocate(field.ToString(), section, size, alignment))
{
if (field.RVA != 0)
{
InitializeStaticValueFromRVA(stream, size, field);
}
else
{
stream.WriteZeroBytes(size);
}
}
}
示例8: AllocateSpace
private void AllocateSpace(MosaField field, SectionKind section, int size, int alignment)
{
using (var stream = Compiler.Linker.Allocate(field.FullName, section, size, alignment))
{
if (field.Data != null)
{
stream.Write(field.Data, 0, size);
}
else
{
stream.WriteZeroBytes(size);
}
}
}
示例9: Allocate
/// <summary>
/// Allocates a symbol of the given name in the specified section.
/// </summary>
/// <param name="name">The name of the symbol.</param>
/// <param name="section">The executable section to allocate From.</param>
/// <param name="size">The number of bytes to allocate. If zero, indicates an unknown amount of memory is required.</param>
/// <param name="alignment">The alignment. A value of zero indicates the use of a default alignment for the section.</param>
/// <returns>
/// A stream, which can be used to populate the section.
/// </returns>
public virtual Stream Allocate(string name, SectionKind section, int size, int alignment)
{
return null;
}
示例10: Section
/// <summary>
/// Initializes a new instance of the <see cref="Section"/> class.
/// </summary>
/// <param name="kind">The kind of the section.</param>
/// <param name="name">The name of the section.</param>
/// <param name="virtualAddress">The virtualAddress of the section.</param>
public Section(SectionKind kind, string name, IntPtr virtualAddress)
: base(kind, name, virtualAddress)
{
stream = new MemoryStream();
}
示例11: GetSectionLength
private uint GetSectionLength(SectionKind sectionKind)
{
LinkerSection section;
if (this.sections.TryGetValue(sectionKind, out section) == true && section.Length > 0)
return (uint)section.Length;
return 0;
}
示例12: GetSection
protected LinkerSection GetSection(SectionKind kind)
{
return Sections[(int)kind];
}
示例13: Link
public void Link(LinkType linkType, PatchType patchType, LinkerSymbol patchSymbol, int patchOffset, int relativeBase, string referenceSymbol, SectionKind patchRelativeBase, int referenceOffset)
{
var referenceObject = GetSymbol(referenceSymbol, patchRelativeBase);
Link(linkType, patchType, patchSymbol, patchOffset, relativeBase, referenceObject, referenceOffset);
}
示例14: GetSymbol
public LinkerSymbol GetSymbol(string name, SectionKind kind)
{
return CreateSymbol(name, kind, 0);
}
示例15: Allocate
/// <summary>
/// Allocates a symbol of the given name in the specified section.
/// </summary>
/// <param name="section">The executable section to allocate From.</param>
/// <param name="size">The number of bytes to allocate. If zero, indicates an unknown amount of memory is required.</param>
/// <param name="alignment">The alignment. A value of zero indicates the use of a default alignment for the section.</param>
/// <returns>
/// A stream, which can be used to populate the section.
/// </returns>
protected abstract Stream Allocate(SectionKind section, int size, int alignment);