| ... | ... | @@ -1194,6 +1194,10 @@ fn allocateTentativeSymbols(self: *Zld) !void { |
| 1194 | 1194 | .section = section, |
| 1195 | 1195 | .weak_ref = false, |
| 1196 | 1196 | .file = tent.file, |
| 1197 | .stab = .{ |
| 1198 | .kind = .global, |
| 1199 | .size = 0, |
| 1200 | }, |
| 1197 | 1201 | }; |
| 1198 | 1202 | |
| 1199 | 1203 | try self.globals.putNoClobber(self.allocator, reg.base.name, &reg.base); |
| ... | ... | @@ -2772,8 +2776,17 @@ fn writeDebugInfo(self: *Zld) !void { |
| 2772 | 2776 | }); |
| 2773 | 2777 | |
| 2774 | 2778 | for (object.symbols.items) |sym| { |
| 2775 | | if (sym.@"type" != .regular) continue; |
| 2776 | | const reg = sym.cast(Symbol.Regular) orelse unreachable; |
| 2779 | const reg = reg: { |
| 2780 | switch (sym.@"type") { |
| 2781 | .regular => break :reg sym.cast(Symbol.Regular) orelse unreachable, |
| 2782 | .tentative => { |
| 2783 | const final = sym.getTopmostAlias().cast(Symbol.Regular) orelse unreachable; |
| 2784 | if (object != final.file) continue; |
| 2785 | break :reg final; |
| 2786 | }, |
| 2787 | else => continue, |
| 2788 | } |
| 2789 | }; |
| 2777 | 2790 | |
| 2778 | 2791 | if (reg.isTemp() or reg.stab == null) continue; |
| 2779 | 2792 | const stab = reg.stab orelse unreachable; |
| ... | ... | @@ -2877,6 +2890,7 @@ fn writeSymbolTable(self: *Zld) !void { |
| 2877 | 2890 | |
| 2878 | 2891 | const reg = final.cast(Symbol.Regular) orelse unreachable; |
| 2879 | 2892 | if (reg.isTemp()) continue; |
| 2893 | if (reg.visited) continue; |
| 2880 | 2894 | |
| 2881 | 2895 | switch (reg.linkage) { |
| 2882 | 2896 | .translation_unit => { |
| ... | ... | @@ -2898,6 +2912,8 @@ fn writeSymbolTable(self: *Zld) !void { |
| 2898 | 2912 | }); |
| 2899 | 2913 | }, |
| 2900 | 2914 | } |
| 2915 | |
| 2916 | reg.visited = true; |
| 2901 | 2917 | } |
| 2902 | 2918 | } |
| 2903 | 2919 | |