Exemplo n.º 1
0
        protected override void CreateSections(EmitContext context)
        {
            CreateTextSection();

            if (Assembly.RootResourceDirectory != null)
            {
                CreateResourceSection();
            }

            if (Assembly.RelocationDirectory != null)
            {
                CreateRelocationSection();
            }

            Assembly.SectionHeaders.Clear();
            Assembly.SectionHeaders.Add(_textSectionHeader);

            if (_relocSectionHeader != null)
            {
                Assembly.SectionHeaders.Add(_relocSectionHeader);
            }
            if (_rsrcSectionHeader != null)
            {
                Assembly.SectionHeaders.Add(_rsrcSectionHeader);
            }

            foreach (var section in Assembly.GetSections())
            {
                SectionTable.AddSection(section);
            }
        }