Debian Codegraph @

src/gnu.rs

raw symbols SCIP
1 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::{Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#, ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#, Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#, Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write#};
2
3 use objectrust-analyzer cargo object 0.39.1 crate/::perust-analyzer cargo object 0.39.1 pe/::*;
4 use objectrust-analyzer cargo object 0.39.1 crate/::writerust-analyzer cargo object 0.39.1 write/::{Objectrust-analyzer cargo object 0.39.1 write/Object#, Relocationrust-analyzer cargo object 0.39.1 write/Relocation#, Symbolrust-analyzer cargo object 0.39.1 write/Symbol#, SymbolIdrust-analyzer cargo object 0.39.1 write/SymbolId#, SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#};
5 use objectrust-analyzer cargo object 0.39.1 crate/::{
6 BinaryFormatrust-analyzer cargo object 0.39.1 common/BinaryFormat#, Endiannessrust-analyzer cargo object 0.39.1 endian/Endianness#, SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#, SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#, SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#, SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#, SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#,
7 };
8
9 use craterust-analyzer cargo implib 0.3.3 crate/::defrust-analyzer cargo implib 0.3.3 def/::{ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport#};
10 use craterust-analyzer cargo implib 0.3.3 crate/::{arrust-analyzer cargo implib 0.3.3 ar/, ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember#, MachineTyperust-analyzer cargo implib 0.3.3 MachineType#};
11
12 const JMP_IX86_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_IX86_BYTES.: [u8; 8] = [0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90];
13 const JMP_ARM_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_ARM_BYTES.: [u8; 12] = [
14 0x00, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc] */
15 0x00, 0xf0, 0x9c, 0xe5, /* ldr pc, [ip] */
16 0, 0, 0, 0,
17 ];
18
19 impl MachineTyperust-analyzer cargo implib 0.3.3 MachineType# {
20 fn to_archrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]to_arch().(self) -> objectrust-analyzer cargo object 0.39.1 crate/::Architecturerust-analyzer cargo object 0.39.1 common/Architecture# {
21 use objectrust-analyzer cargo object 0.39.1 crate/::Architecturerust-analyzer cargo object 0.39.1 common/Architecture#::*;
22 match self {
23 Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]::AMD64rust-analyzer cargo implib 0.3.3 MachineType#AMD64# => X86_64rust-analyzer cargo object 0.39.1 common/Architecture#X86_64#,
24 Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]::ARMNTrust-analyzer cargo implib 0.3.3 MachineType#ARMNT# => Armrust-analyzer cargo object 0.39.1 common/Architecture#Arm#,
25 Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]::ARM64rust-analyzer cargo implib 0.3.3 MachineType#ARM64# => Aarch64rust-analyzer cargo object 0.39.1 common/Architecture#Aarch64#,
26 Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]::I386rust-analyzer cargo implib 0.3.3 MachineType#I386# => I386rust-analyzer cargo object 0.39.1 common/Architecture#I386#,
27 }
28 }
29 }
30
31 /// GNU flavored Windows import library generator
32 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:, Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone:)]
33 pub struct GnuImportLibraryrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary# {
34 defrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#def.: ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#,
35 machinerust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#machine.: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#,
36 }
37
38 impl GnuImportLibraryrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary# {
39 /// Create new import library generator from `ModuleDef`
40 pub fn newrust-analyzer cargo implib 0.3.3 gnu/impl#[GnuImportLibrary]new().(mut def: ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#, machine: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#) -> Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[GnuImportLibrary] {
41 // If ext_name is set (if the "ext_name = name" syntax was used), overwrite
42 // name with ext_name and clear ext_name. When only creating an import
43 // library and not linking, the internal name is irrelevant.
44 for export in &mut def.exportsrust-analyzer cargo implib 0.3.3 def/ModuleDef#exports. {
45 if let Somerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#Some#(ext_name) = export.ext_namerust-analyzer cargo implib 0.3.3 def/ShortExport#ext_name..takerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/impl#[`Option<T>`]take().() {
46 export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name. = ext_name;
47 }
48 }
49 // Skipped i386 handling
50 // See https://github.com/llvm/llvm-project/blob/09c2b7c35af8c4bad39f03e9f60df8bd07323028/llvm/lib/ToolDrivers/llvm-dlltool/DlltoolDriver.cpp#L197-L212
51 GnuImportLibraryrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary# { defrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#def., machinerust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#machine. }
52 }
53
54 /// Write out the import library
55 pub fn write_torust-analyzer cargo implib 0.3.3 gnu/impl#[GnuImportLibrary]write_to().<W: Writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Write# + Seekrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/Seek#>(&self, writer: &mut W) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<(), Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
56 let mut members = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
57 let mut factory = ObjectFactoryrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#::newrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]new().(&self.defrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#def..import_namerust-analyzer cargo implib 0.3.3 def/ModuleDef#import_name., self.machinerust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#machine.)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
58 for export in &self.defrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#def..exportsrust-analyzer cargo implib 0.3.3 def/ModuleDef#exports. {
59 members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(factory.make_onerust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_one().(export)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().());
60 }
61 members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(factory.make_headrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_head().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().());
62 members.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(factory.make_tailrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_tail().()?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch()..create_archive_entryrust-analyzer cargo implib 0.3.3 impl#[ArchiveMember]create_archive_entry().());
63 members.reverserust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]reverse().();
64
65 let identifiers = members
66 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
67 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(header, _)| header.identifierrust-analyzer cargo implib 0.3.3 ar/impl#[Header]identifier().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().())
68 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
69 let symbol_table: Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>> = members
70 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
71 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|(_, member)| {
72 member
73 .symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.
74 .iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]iter().()
75 .maprust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#map().(|s| s.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().().into_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]into_bytes().())
76 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().::<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#<u8>>>()
77 })
78 .collectrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#collect().();
79 let mut archive =
80 arrust-analyzer cargo implib 0.3.3 ar/::GnuBuilderrust-analyzer cargo implib 0.3.3 ar/write/GnuBuilder#::new_with_symbol_tablerust-analyzer cargo implib 0.3.3 ar/write/impl#[`GnuBuilder<W>`]new_with_symbol_table().(writer, true, identifiers, symbol_table)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
81 for (header, member) in members {
82 archive.appendrust-analyzer cargo implib 0.3.3 ar/write/impl#[`GnuBuilder<W>`]append().(&header, &member.datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`Index<I>`]index().)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
83 }
84 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(())
85 }
86 }
87
88 #[deriverust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/derive:(Debugrust-analyzer cargo core https://github.com/rust-lang/rust/library/core fmt/macros/Debug:)]
89 struct ObjectFactoryrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#<'a> {
90 machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine.: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#,
91 import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name.: &'a str,
92 output_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#output_name.: Stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/String#,
93 seqrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#seq.: usize,
94 }
95
96 impl<'a> ObjectFactoryrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#<'a> {
97 fn newrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]new().(import_name: &'a str, machine: MachineTyperust-analyzer cargo implib 0.3.3 MachineType#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`], Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
98 if import_name.containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().('\0') {
99 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(
100 ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#,
101 "import name contains null byte".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
102 ));
103 }
104 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(Selfrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`] {
105 machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine.,
106 import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name.,
107 output_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#output_name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}.a", import_name),
108 seqrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#seq.: 0,
109 })
110 }
111 fn make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(
112 &self,
113 offset: u64,
114 symbol: SymbolIdrust-analyzer cargo object 0.39.1 write/SymbolId#,
115 addend: i64,
116 rel_kind: u16,
117 ) -> Relocationrust-analyzer cargo object 0.39.1 write/Relocation# {
118 Relocationrust-analyzer cargo object 0.39.1 write/Relocation# {
119 offsetrust-analyzer cargo object 0.39.1 write/Relocation#offset.,
120 symbolrust-analyzer cargo object 0.39.1 write/Relocation#symbol.,
121 addendrust-analyzer cargo object 0.39.1 write/Relocation#addend.,
122 flagsrust-analyzer cargo object 0.39.1 write/Relocation#flags.: objectrust-analyzer cargo object 0.39.1 crate/::RelocationFlagsrust-analyzer cargo object 0.39.1 common/RelocationFlags#::Coffrust-analyzer cargo object 0.39.1 common/RelocationFlags#Coff# { typrust-analyzer cargo object 0.39.1 common/RelocationFlags#Coff#typ.: rel_kind },
123 }
124 }
125 fn make_headrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_head().(&self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember#, Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
126 let mut obj = Objectrust-analyzer cargo object 0.39.1 write/Object#::newrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]new().(
127 BinaryFormatrust-analyzer cargo object 0.39.1 common/BinaryFormat#::Coffrust-analyzer cargo object 0.39.1 common/BinaryFormat#Coff#,
128 self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine..to_archrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]to_arch().(),
129 Endiannessrust-analyzer cargo object 0.39.1 endian/Endianness#::Littlerust-analyzer cargo object 0.39.1 endian/Endianness#Little#,
130 );
131 let text_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".text".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Textrust-analyzer cargo object 0.39.1 common/SectionKind#Text#);
132 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(text_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
133 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
134 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_CODErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_CODE.
135 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_EXECUTErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_EXECUTE.
136 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.,
137 };
138
139 let data_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".data".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
140 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(data_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
141 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
142 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
143 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
144 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
145 };
146
147 let bss_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".bss".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::UninitializedDatarust-analyzer cargo object 0.39.1 common/SectionKind#UninitializedData#);
148 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(bss_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
149 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
150 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_UNINITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_UNINITIALIZED_DATA.
151 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
152 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
153 };
154
155 let id2 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$2".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
156 let id5 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$5".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
157 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id5).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
158 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
159 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
160 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
161 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
162 };
163 let id4 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$4".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
164 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id4).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
165 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
166 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
167 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
168 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
169 };
170
171 obj.add_file_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_file_symbol().(b"fake".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().());
172 let id5_sym = obj.section_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_symbol().(id5);
173 let id4_sym = obj.section_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_symbol().(id4);
174 let img_rel = self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine..img_rel_relocationrust-analyzer cargo implib 0.3.3 impl#[MachineType]img_rel_relocation().();
175 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id2, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(0, id4_sym, 0, img_rel))
176 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
177 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id2, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(16, id5_sym, 0, img_rel))
178 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
179
180 let import_name = self.import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_");
181
182 let head_sym_name = formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("_head_{}", import_name);
183 let head_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
184 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: head_sym_name.as_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(),
185 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
186 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
187 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
188 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
189 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
190 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Sectionrust-analyzer cargo object 0.39.1 write/SymbolSection#Section#(id2),
191 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
192 };
193 obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(head_sym);
194
195 let iname_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
196 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}_iname", import_name).into_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]into_bytes().(),
197 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
198 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
199 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
200 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
201 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
202 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Undefinedrust-analyzer cargo object 0.39.1 write/SymbolSection#Undefined#,
203 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
204 };
205 let iname_sym_id = obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(iname_sym);
206
207 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id2, &[0; 20], 4);
208 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id2, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(12, iname_sym_id, 0, img_rel))
209 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
210 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# {
211 namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}_h.o", self.output_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#output_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_")),
212 datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: obj
213 .writerust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]write().()
214 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
215 symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![head_sym_name],
216 })
217 }
218
219 fn make_tailrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_tail().(&self) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember#, Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
220 let mut obj = Objectrust-analyzer cargo object 0.39.1 write/Object#::newrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]new().(
221 BinaryFormatrust-analyzer cargo object 0.39.1 common/BinaryFormat#::Coffrust-analyzer cargo object 0.39.1 common/BinaryFormat#Coff#,
222 self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine..to_archrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]to_arch().(),
223 Endiannessrust-analyzer cargo object 0.39.1 endian/Endianness#::Littlerust-analyzer cargo object 0.39.1 endian/Endianness#Little#,
224 );
225 let text_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".text".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Textrust-analyzer cargo object 0.39.1 common/SectionKind#Text#);
226 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(text_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
227 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
228 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_CODErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_CODE.
229 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_EXECUTErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_EXECUTE.
230 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.,
231 };
232
233 let data_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".data".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
234 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(data_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
235 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
236 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
237 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
238 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
239 };
240
241 let bss_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".bss".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::UninitializedDatarust-analyzer cargo object 0.39.1 common/SectionKind#UninitializedData#);
242 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(bss_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
243 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_16BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_16BYTES.
244 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_UNINITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_UNINITIALIZED_DATA.
245 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
246 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
247 };
248
249 let id4 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$4".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
250 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id4).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
251 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
252 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
253 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
254 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
255 };
256 let id5 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$5".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
257 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id5).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
258 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
259 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
260 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
261 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
262 };
263 let id7 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$7".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
264 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id4).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
265 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
266 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
267 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
268 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
269 };
270
271 obj.add_file_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_file_symbol().(b"fake".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().());
272
273 let import_name = self.import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_");
274 let iname_sym_name = formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}_iname", import_name);
275 let iname_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
276 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: iname_sym_name.as_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(),
277 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
278 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
279 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
280 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
281 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
282 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Sectionrust-analyzer cargo object 0.39.1 write/SymbolSection#Section#(id7),
283 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
284 };
285 obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(iname_sym);
286
287 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id4, &[0; 8], 4);
288 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id5, &[0; 8], 4);
289
290 let mut import_name_bytes = self.import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name..as_bytesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().();
291 import_name_bytes.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(b'\0');
292 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id7, &import_name_bytes, 4);
293
294 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# {
295 namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}_t.o", self.output_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#output_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_")),
296 datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: obj
297 .writerust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]write().()
298 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
299 symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![iname_sym_name],
300 })
301 }
302
303 fn make_onerust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_one().(&mut self, export: &ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember#, Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#> {
304 if export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name..containsrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]contains().('\0') {
305 return Errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Err#(Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(
306 ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::InvalidInputrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#InvalidInput#,
307 "export name contains null byte".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
308 ));
309 }
310
311 let mut obj = Objectrust-analyzer cargo object 0.39.1 write/Object#::newrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]new().(
312 BinaryFormatrust-analyzer cargo object 0.39.1 common/BinaryFormat#::Coffrust-analyzer cargo object 0.39.1 common/BinaryFormat#Coff#,
313 self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine..to_archrust-analyzer cargo implib 0.3.3 gnu/impl#[MachineType]to_arch().(),
314 Endiannessrust-analyzer cargo object 0.39.1 endian/Endianness#::Littlerust-analyzer cargo object 0.39.1 endian/Endianness#Little#,
315 );
316
317 let text_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".text".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Textrust-analyzer cargo object 0.39.1 common/SectionKind#Text#);
318 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(text_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
319 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
320 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_CODErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_CODE.
321 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_EXECUTErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_EXECUTE.
322 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.,
323 };
324
325 let data_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".data".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
326 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(data_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
327 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
328 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_INITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_INITIALIZED_DATA.
329 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
330 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
331 };
332
333 let bss_sec = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".bss".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::UninitializedDatarust-analyzer cargo object 0.39.1 common/SectionKind#UninitializedData#);
334 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(bss_sec).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
335 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES.
336 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_CNT_UNINITIALIZED_DATArust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_CNT_UNINITIALIZED_DATA.
337 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ.
338 |rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
339 };
340
341 let id7 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$7".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
342 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id7).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
343 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
344 };
345 let id5 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$5".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
346 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id5).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
347 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
348 };
349 let id4 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$4".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
350 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id4).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
351 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_4BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_4BYTES. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
352 };
353 let id6 = obj.add_sectionrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_section().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().(), b".idata$6".to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(), SectionKindrust-analyzer cargo object 0.39.1 common/SectionKind#::Datarust-analyzer cargo object 0.39.1 common/SectionKind#Data#);
354 obj.section_mutrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_mut().(id6).flagsrust-analyzer cargo object 0.39.1 write/Section#flags. = SectionFlagsrust-analyzer cargo object 0.39.1 common/SectionFlags#::Coffrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff# {
355 characteristicsrust-analyzer cargo object 0.39.1 common/SectionFlags#Coff#characteristics.: IMAGE_SCN_ALIGN_2BYTESrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_ALIGN_2BYTES. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_READrust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_READ. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().|rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u32][`BitOr<Self>`]bitor().IMAGE_SCN_MEM_WRITErust-analyzer cargo object 0.39.1 pe/IMAGE_SCN_MEM_WRITE.,
356 };
357
358 let import_name = self.import_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#import_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_");
359 let head_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
360 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("_head_{}", import_name).into_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]into_bytes().(),
361 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
362 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
363 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
364 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
365 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
366 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Undefinedrust-analyzer cargo object 0.39.1 write/SymbolSection#Undefined#,
367 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
368 };
369 let head_sym = obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(head_sym);
370
371 let mut archive_symbols = Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().();
372 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().export.datarust-analyzer cargo implib 0.3.3 def/ShortExport#data. {
373 let exp_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
374 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name..as_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_bytes().().to_vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc slice/impl#[`[T]`]to_vec().(),
375 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
376 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
377 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
378 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
379 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
380 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Sectionrust-analyzer cargo object 0.39.1 write/SymbolSection#Section#(text_sec),
381 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
382 };
383 obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(exp_sym);
384 archive_symbols.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name..to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().());
385 }
386 let exp_imp_sym = Symbolrust-analyzer cargo object 0.39.1 write/Symbol# {
387 namerust-analyzer cargo object 0.39.1 write/Symbol#name.: formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("__imp_{}", export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name.).into_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]into_bytes().(),
388 valuerust-analyzer cargo object 0.39.1 write/Symbol#value.: 0,
389 sizerust-analyzer cargo object 0.39.1 write/Symbol#size.: 0,
390 kindrust-analyzer cargo object 0.39.1 write/Symbol#kind.: SymbolKindrust-analyzer cargo object 0.39.1 common/SymbolKind#::Datarust-analyzer cargo object 0.39.1 common/SymbolKind#Data#,
391 scoperust-analyzer cargo object 0.39.1 write/Symbol#scope.: SymbolScoperust-analyzer cargo object 0.39.1 common/SymbolScope#::Dynamicrust-analyzer cargo object 0.39.1 common/SymbolScope#Dynamic#,
392 weakrust-analyzer cargo object 0.39.1 write/Symbol#weak.: false,
393 sectionrust-analyzer cargo object 0.39.1 write/Symbol#section.: SymbolSectionrust-analyzer cargo object 0.39.1 write/SymbolSection#::Sectionrust-analyzer cargo object 0.39.1 write/SymbolSection#Section#(id5),
394 flagsrust-analyzer cargo object 0.39.1 write/Symbol#flags.: SymbolFlagsrust-analyzer cargo object 0.39.1 common/SymbolFlags#::Nonerust-analyzer cargo object 0.39.1 common/SymbolFlags#None#,
395 };
396 let exp_imp_sym = obj.add_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_symbol().(exp_imp_sym);
397 archive_symbols.pushrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`]push().(formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("__imp_{}", export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name.));
398
399 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().export.datarust-analyzer cargo implib 0.3.3 def/ShortExport#data. {
400 let (jmp_stub, offset, rel_kind) = match self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine. {
401 MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::I386rust-analyzer cargo implib 0.3.3 MachineType#I386# => (&JMP_IX86_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_IX86_BYTES.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., 2, IMAGE_REL_I386_REL32rust-analyzer cargo object 0.39.1 pe/IMAGE_REL_I386_REL32.),
402 MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::ARMNTrust-analyzer cargo implib 0.3.3 MachineType#ARMNT# => (&JMP_ARM_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_ARM_BYTES.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., 8, IMAGE_REL_ARM_REL32rust-analyzer cargo object 0.39.1 pe/IMAGE_REL_ARM_REL32.),
403 MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::AMD64rust-analyzer cargo implib 0.3.3 MachineType#AMD64# => (&JMP_IX86_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_IX86_BYTES.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., 2, IMAGE_REL_AMD64_REL32rust-analyzer cargo object 0.39.1 pe/IMAGE_REL_AMD64_REL32.),
404 MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::ARM64rust-analyzer cargo implib 0.3.3 MachineType#ARM64# => (&JMP_ARM_BYTESrust-analyzer cargo implib 0.3.3 gnu/JMP_ARM_BYTES.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()...rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/RangeFull#]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index()., 8, IMAGE_REL_ARM64_REL32rust-analyzer cargo object 0.39.1 pe/IMAGE_REL_ARM64_REL32.),
405 };
406 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(text_sec, jmp_stub, 4);
407 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(
408 text_sec,
409 self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(offset, exp_imp_sym, 0, rel_kind),
410 )
411 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
412 }
413
414 let img_rel = self.machinerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#machine..img_rel_relocationrust-analyzer cargo implib 0.3.3 impl#[MachineType]img_rel_relocation().();
415
416 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id7, &[0; 4], 4);
417 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id7, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(0, head_sym, 0, img_rel))
418 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
419
420 let id6_sym = obj.section_symbolrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]section_symbol().(id6);
421 let id5_data = if export.no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name. {
422 [
423 export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal. as u8,
424 (export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().8) as u8,
425 0,
426 0,
427 0,
428 0,
429 0,
430 0x80,
431 ]
432 } else {
433 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id5, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(0, id6_sym, 0, img_rel))
434 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
435 [0; 8]
436 };
437 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id5, &id5_data, 4);
438
439 let id4_data = if export.no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name. {
440 [
441 export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal. as u8,
442 (export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().8) as u8,
443 0,
444 0,
445 0,
446 0,
447 0,
448 0x80,
449 ]
450 } else {
451 obj.add_relocationrust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]add_relocation().(id4, self.make_relocationrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_relocation().(0, id6_sym, 0, img_rel))
452 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().;
453 [0; 8]
454 };
455 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id4, &id4_data, 4);
456
457 if !rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[bool][Not]not().export.no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name. {
458 let len = 2 rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name..lenrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]len().() rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().+rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Add<Self>`]add().1;
459 let mut id6_data = vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/vec!![0; len];
460 let ord = export.ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal.;
461 id6_data[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().0]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = ord as u8;
462 id6_data[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut(). = (ord rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().>>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/bit/impl#[u16][`Shr<i32>`]shr().8) as u8;
463 id6_data[rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut().2..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#len rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().-rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`Sub<Self>`]sub().1]rust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T, A>`][`IndexMut<I>`]index_mut()..copy_from_slicerust-analyzer cargo core https://github.com/rust-lang/rust/library/core slice/impl#[`[T]`]copy_from_slice().(export.namerust-analyzer cargo implib 0.3.3 def/ShortExport#name..as_bytesrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[String]as_bytes().());
464 obj.append_section_datarust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]append_section_data().(id6, &id6_data, 2);
465 }
466
467 let name = formatrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc macros/format!!("{}_s{:05}.o", self.output_namerust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#output_name..replacerust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc str/impl#[str]replace().('.', "_"), self.seqrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#seq.);
468 self.seqrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#seq. rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().+=rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[usize][`AddAssign<Self>`]add_assign().1;
469
470 Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(ArchiveMemberrust-analyzer cargo implib 0.3.3 ArchiveMember# {
471 namerust-analyzer cargo implib 0.3.3 ArchiveMember#name.,
472 datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.: obj
473 .writerust-analyzer cargo object 0.39.1 write/impl#[`Object<'a>`]write().()
474 .map_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_err().(|e| Errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/Error#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/impl#[Error]new().(ErrorKindrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#::Otherrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/error/ErrorKind#Other#, e.to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().()))?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().,
475 symbolsrust-analyzer cargo implib 0.3.3 ArchiveMember#symbols.: archive_symbols,
476 })
477 }
478 }
479
480 #[cfg(test)]
481 mod testrust-analyzer cargo implib 0.3.3 gnu/test/ {
482 use superrust-analyzer cargo implib 0.3.3 gnu/::*;
483 use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::iorust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/::Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#;
484
485 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
486 fn test_gnu_with_bad_inputrust-analyzer cargo implib 0.3.3 gnu/test/test_gnu_with_bad_input().() {
487 let import_lib = GnuImportLibraryrust-analyzer cargo implib 0.3.3 gnu/GnuImportLibrary#::newrust-analyzer cargo implib 0.3.3 gnu/impl#[GnuImportLibrary]new().(
488 ModuleDefrust-analyzer cargo implib 0.3.3 def/ModuleDef#::parserust-analyzer cargo implib 0.3.3 def/impl#[ModuleDef]parse().("EXPORTS D\u{c}\0", MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::AMD64rust-analyzer cargo implib 0.3.3 MachineType#AMD64#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(),
489 MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::AMD64rust-analyzer cargo implib 0.3.3 MachineType#AMD64#,
490 );
491 import_lib
492 .write_torust-analyzer cargo implib 0.3.3 gnu/impl#[GnuImportLibrary]write_to().(&mut Cursorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/Cursor#::newrust-analyzer cargo std https://github.com/rust-lang/rust/library/std io/cursor/impl#[`Cursor<T>`]new().(Vecrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/Vec#::newrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc vec/impl#[`Vec<T>`]new().()))
493 .unwrap_errrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap_err().();
494 }
495
496 #[ignore]
497 #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:]
498 fn debug_head_tail_exportrust-analyzer cargo implib 0.3.3 gnu/test/debug_head_tail_export().() {
499 let mut factory = ObjectFactoryrust-analyzer cargo implib 0.3.3 gnu/ObjectFactory#::newrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]new().("python39.dll", MachineTyperust-analyzer cargo implib 0.3.3 MachineType#::AMD64rust-analyzer cargo implib 0.3.3 MachineType#AMD64#).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
500 let head = factory.make_headrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_head().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
501 stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/write().("head.o", head.datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
502
503 let tail = factory.make_tailrust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_tail().().unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
504 stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/write().("tail.o", tail.datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
505
506 let export = ShortExportrust-analyzer cargo implib 0.3.3 def/ShortExport# {
507 namerust-analyzer cargo implib 0.3.3 def/ShortExport#name.: "PyAST_CompileEx".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
508 ext_namerust-analyzer cargo implib 0.3.3 def/ShortExport#ext_name.: Nonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core option/Option#None#,
509 symbol_namerust-analyzer cargo implib 0.3.3 def/ShortExport#symbol_name.: "".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
510 alias_targetrust-analyzer cargo implib 0.3.3 def/ShortExport#alias_target.: "".to_stringrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc string/impl#[T][ToString]to_string().(),
511 ordinalrust-analyzer cargo implib 0.3.3 def/ShortExport#ordinal.: 0,
512 no_namerust-analyzer cargo implib 0.3.3 def/ShortExport#no_name.: false,
513 datarust-analyzer cargo implib 0.3.3 def/ShortExport#data.: false,
514 privaterust-analyzer cargo implib 0.3.3 def/ShortExport#private.: false,
515 constantrust-analyzer cargo implib 0.3.3 def/ShortExport#constant.: false,
516 };
517 let exp = factory.make_onerust-analyzer cargo implib 0.3.3 gnu/impl#[`ObjectFactory<'a>`]make_one().(&export).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
518 stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::fsrust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/::writerust-analyzer cargo std https://github.com/rust-lang/rust/library/std fs/write().("exp.o", exp.datarust-analyzer cargo implib 0.3.3 ArchiveMember#data.).unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().();
519 }
520 }