| ... | ... | @@ -1038,6 +1038,10 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod |
| 1038 | 1038 | |
| 1039 | 1039 | // Beyond this point, everything has been allocated a virtual address and we can resolve |
| 1040 | 1040 | // the relocations, and commit objects to file. |
| 1041 | for (self.objects.items) |index| { |
| 1042 | self.file(index).?.object.dirty = false; |
| 1043 | } |
| 1044 | |
| 1041 | 1045 | if (self.zigObjectPtr()) |zo| { |
| 1042 | 1046 | var has_reloc_errors = false; |
| 1043 | 1047 | for (zo.atoms_indexes.items) |atom_index| { |
| ... | ... | @@ -1399,7 +1403,6 @@ pub fn parseLibraryReportingFailure(self: *Elf, lib: SystemLib, must_link: bool) |
| 1399 | 1403 | fn parseLibrary(self: *Elf, lib: SystemLib, must_link: bool) ParseError!void { |
| 1400 | 1404 | const tracy = trace(@src()); |
| 1401 | 1405 | defer tracy.end(); |
| 1402 | | |
| 1403 | 1406 | if (try Archive.isArchive(lib.path)) { |
| 1404 | 1407 | try self.parseArchive(lib.path, must_link); |
| 1405 | 1408 | } else if (try SharedObject.isSharedObject(lib.path)) { |
| ... | ... | @@ -2799,9 +2802,10 @@ pub fn resolveMergeSections(self: *Elf) !void { |
| 2799 | 2802 | |
| 2800 | 2803 | var has_errors = false; |
| 2801 | 2804 | for (self.objects.items) |index| { |
| 2802 | | const file_ptr = self.file(index).?; |
| 2803 | | if (!file_ptr.isAlive()) continue; |
| 2804 | | file_ptr.object.initInputMergeSections(self) catch |err| switch (err) { |
| 2805 | const object = self.file(index).?.object; |
| 2806 | if (!object.alive) continue; |
| 2807 | if (!object.dirty) continue; |
| 2808 | object.initInputMergeSections(self) catch |err| switch (err) { |
| 2805 | 2809 | error.LinkFailure => has_errors = true, |
| 2806 | 2810 | else => |e| return e, |
| 2807 | 2811 | }; |
| ... | ... | @@ -2810,15 +2814,17 @@ pub fn resolveMergeSections(self: *Elf) !void { |
| 2810 | 2814 | if (has_errors) return error.FlushFailure; |
| 2811 | 2815 | |
| 2812 | 2816 | for (self.objects.items) |index| { |
| 2813 | | const file_ptr = self.file(index).?; |
| 2814 | | if (!file_ptr.isAlive()) continue; |
| 2815 | | try file_ptr.object.initOutputMergeSections(self); |
| 2817 | const object = self.file(index).?.object; |
| 2818 | if (!object.alive) continue; |
| 2819 | if (!object.dirty) continue; |
| 2820 | try object.initOutputMergeSections(self); |
| 2816 | 2821 | } |
| 2817 | 2822 | |
| 2818 | 2823 | for (self.objects.items) |index| { |
| 2819 | | const file_ptr = self.file(index).?; |
| 2820 | | if (!file_ptr.isAlive()) continue; |
| 2821 | | file_ptr.object.resolveMergeSubsections(self) catch |err| switch (err) { |
| 2824 | const object = self.file(index).?.object; |
| 2825 | if (!object.alive) continue; |
| 2826 | if (!object.dirty) continue; |
| 2827 | object.resolveMergeSubsections(self) catch |err| switch (err) { |
| 2822 | 2828 | error.LinkFailure => has_errors = true, |
| 2823 | 2829 | else => |e| return e, |
| 2824 | 2830 | }; |