| ... | ... | @@ -146,13 +146,14 @@ pub fn parseObject( |
| 146 | 146 | archive: Archive, |
| 147 | 147 | wasm: *Wasm, |
| 148 | 148 | file_contents: []const u8, |
| 149 | object_offset: u32, |
| 149 | 150 | path: Path, |
| 150 | 151 | host_name: Wasm.OptionalString, |
| 151 | 152 | scratch_space: *Object.ScratchSpace, |
| 152 | 153 | must_link: bool, |
| 153 | 154 | gc_sections: bool, |
| 154 | 155 | ) !Object { |
| 155 | | const header = mem.bytesAsValue(Header, file_contents[0..@sizeOf(Header)]); |
| 156 | const header = mem.bytesAsValue(Header, file_contents[object_offset..][0..@sizeOf(Header)]); |
| 156 | 157 | if (!mem.eql(u8, &header.fmag, ARFMAG)) return error.BadHeaderDelimiter; |
| 157 | 158 | |
| 158 | 159 | const name_or_index = try header.nameOrIndex(); |
| ... | ... | @@ -166,7 +167,7 @@ pub fn parseObject( |
| 166 | 167 | }; |
| 167 | 168 | |
| 168 | 169 | const object_file_size = try header.parsedSize(); |
| 169 | | const contents = file_contents[@sizeOf(Header)..][0..object_file_size]; |
| 170 | const contents = file_contents[object_offset + @sizeOf(Header) ..][0..object_file_size]; |
| 170 | 171 | |
| 171 | 172 | return Object.parse(wasm, contents, path, object_name, host_name, scratch_space, must_link, gc_sections); |
| 172 | 173 | } |