Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Elf64Section"/> class.
 /// </summary>
 /// <param name="kind">The kind of the section.</param>
 /// <param name="name">The name.</param>
 /// <param name="virtualAddress">The virtualAddress.</param>
 public Elf64Section(Mosa.Compiler.Linker.SectionKind kind, string name, IntPtr virtualAddress)
     : base(kind, name, virtualAddress)
 {
     header        = new Elf64SectionHeader();
     header.Name   = Elf64StringTableSection.AddString(name);
     sectionStream = new System.IO.MemoryStream();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Elf64Linker"/> class.
        /// </summary>
        public Elf64Linker()
        {
            this.sections = new List<LinkerSection>();

            // Create the default section set
            Elf64Section[] sections = new Elf64Section[(int)SectionKind.Max];
            sections[(int)SectionKind.Text] = new Elf64CodeSection();
            sections[(int)SectionKind.Data] = new Elf64DataSection();
            sections[(int)SectionKind.ROData] = new Elf64RoDataSection();
            sections[(int)SectionKind.BSS] = new Elf64BssSection();
            this.sections.AddRange(sections);

            nullSection = new Elf64NullSection();
            stringTableSection = new Elf64StringTableSection();
        }