예제 #1
0
 /// <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
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Elf32Linker"/> class.
        /// </summary>
        public Elf32Linker()
        {
            _sections = new List<LinkerSection>();
            _fileAlignment = FileSectionAlignment;
            _sectionAlignment = SectionAlignment;

            // Create the default section set
            Elf32Section[] sections = new Elf32Section[(int)SectionKind.Max];
            sections[(int)SectionKind.Text] = new Elf32CodeSection();
            sections[(int)SectionKind.Data] = new Elf32DataSection();
            sections[(int)SectionKind.ROData] = new Elf32RoDataSection();
            sections[(int)SectionKind.BSS] = new Elf32BssSection();
            _sections.AddRange(sections);

            _nullSection = new Elf32NullSection();
            _stringTableSection = new Elf32StringTableSection();
        }