| ... | @@ -2021,11 +2021,6 @@ fn scanRelocs(self: *Elf) !void { | ... | @@ -2021,11 +2021,6 @@ fn scanRelocs(self: *Elf) !void { |
| 2021 | undefs.deinit(); | 2021 | undefs.deinit(); |
| 2022 | } | 2022 | } |
| 2023 | | 2023 | |
| 2024 | var objects = try std.ArrayList(File.Index).initCapacity(gpa, self.objects.items.len + 1); | | |
| 2025 | defer objects.deinit(); | | |
| 2026 | if (self.zigObjectPtr()) |zo| objects.appendAssumeCapacity(zo.index); | | |
| 2027 | objects.appendSliceAssumeCapacity(self.objects.items); | | |
| 2028 | | | |
| 2029 | var has_reloc_errors = false; | 2024 | var has_reloc_errors = false; |
| 2030 | if (self.zigObjectPtr()) |zo| { | 2025 | if (self.zigObjectPtr()) |zo| { |
| 2031 | zo.asFile().scanRelocs(self, &undefs) catch |err| switch (err) { | 2026 | zo.asFile().scanRelocs(self, &undefs) catch |err| switch (err) { |
| ... | @@ -2063,6 +2058,9 @@ fn scanRelocs(self: *Elf) !void { | ... | @@ -2063,6 +2058,9 @@ fn scanRelocs(self: *Elf) !void { |
| 2063 | for (self.shared_objects.items) |index| { | 2058 | for (self.shared_objects.items) |index| { |
| 2064 | try self.file(index).?.createSymbolIndirection(self); | 2059 | try self.file(index).?.createSymbolIndirection(self); |
| 2065 | } | 2060 | } |
| | 2061 | if (self.linkerDefinedPtr()) |obj| { |
| | 2062 | try obj.asFile().createSymbolIndirection(self); |
| | 2063 | } |
| 2066 | if (self.got.flags.needs_tlsld) { | 2064 | if (self.got.flags.needs_tlsld) { |
| 2067 | log.debug("program needs TLSLD", .{}); | 2065 | log.debug("program needs TLSLD", .{}); |
| 2068 | try self.got.addTlsLdSymbol(self); | 2066 | try self.got.addTlsLdSymbol(self); |