示例#1
0
        private void Given_Linker(bool big_endian)
        {
            BuildObjectFile32();

            var eil = new ElfImageLoader(sc, "foo.o", rawBytes);

            eil.LoadElfIdentification();
            var eh = Elf32_EHdr.Load(new BeImageReader(rawBytes, ElfImageLoader.HEADER_OFFSET));
            var el = new ElfLoader32(eil, eh, rawBytes, big_endian ? ElfLoader.ELFDATA2MSB : ElfLoader.ELFDATA2LSB);

            el.LoadSectionHeaders();
            el.LoadSymbolsFromSections();
            this.linker = new ElfObjectLinker32(el, arch.Object, rawBytes);
        }
示例#2
0
        private void Given_Linker()
        {
            BuildObjectFile32();
            mr.ReplayAll();

            var eil = new ElfImageLoader(sc, "foo.o", rawBytes);

            eil.LoadElfIdentification();
            var eh = Elf32_EHdr.Load(new BeImageReader(rawBytes, ElfImageLoader.HEADER_OFFSET));
            var el = new ElfLoader32(eil, eh, rawBytes);

            el.LoadSectionHeaders();
            el.LoadSymbols();
            this.linker = new ElfObjectLinker32(el, arch, rawBytes);
        }
示例#3
0
        private void Given_Linker(bool big_endian)
        {
            BuildObjectFile32(big_endian);
            var eil = new ElfImageLoader(sc, ImageLocation.FromUri("file:foo.o"), rawBytes);

            eil.LoadElfIdentification();
            var rdr = big_endian
                ? new BeImageReader(rawBytes, ElfImageLoader.HEADER_OFFSET)
                : (EndianImageReader) new LeImageReader(rawBytes, ElfImageLoader.HEADER_OFFSET);
            var eh = Elf32_EHdr.Load(rdr);
            var el = new ElfLoader32(sc, eh, 0, big_endian ? EndianServices.Big: EndianServices.Little, rawBytes);

            el.Sections.AddRange(el.LoadSectionHeaders());
            el.LoadSymbolsFromSections();
            this.linker = new ElfObjectLinker32(el, arch.Object, rawBytes);
        }