| ... | @@ -956,10 +956,10 @@ pub const ElfFile = struct { | ... | @@ -956,10 +956,10 @@ pub const ElfFile = struct { |
| 956 | try self.offset_table_free_list.ensureCapacity(self.allocator, self.local_symbols.items.len); | 956 | try self.offset_table_free_list.ensureCapacity(self.allocator, self.local_symbols.items.len); |
| 957 | | 957 | |
| 958 | if (self.local_symbol_free_list.popOrNull()) |i| { | 958 | if (self.local_symbol_free_list.popOrNull()) |i| { |
| 959 | std.debug.warn("reusing symbol index {} for {}\n", .{i, decl.name}); | 959 | //std.debug.warn("reusing symbol index {} for {}\n", .{i, decl.name}); |
| 960 | decl.link.local_sym_index = i; | 960 | decl.link.local_sym_index = i; |
| 961 | } else { | 961 | } else { |
| 962 | std.debug.warn("allocating symbol index {} for {}\n", .{self.local_symbols.items.len, decl.name}); | 962 | //std.debug.warn("allocating symbol index {} for {}\n", .{self.local_symbols.items.len, decl.name}); |
| 963 | decl.link.local_sym_index = @intCast(u32, self.local_symbols.items.len); | 963 | decl.link.local_sym_index = @intCast(u32, self.local_symbols.items.len); |
| 964 | _ = self.local_symbols.addOneAssumeCapacity(); | 964 | _ = self.local_symbols.addOneAssumeCapacity(); |
| 965 | } | 965 | } |
| ... | @@ -1027,11 +1027,11 @@ pub const ElfFile = struct { | ... | @@ -1027,11 +1027,11 @@ pub const ElfFile = struct { |
| 1027 | !mem.isAlignedGeneric(u64, local_sym.st_value, required_alignment); | 1027 | !mem.isAlignedGeneric(u64, local_sym.st_value, required_alignment); |
| 1028 | if (need_realloc) { | 1028 | if (need_realloc) { |
| 1029 | const vaddr = try self.growTextBlock(&decl.link, code.len, required_alignment); | 1029 | const vaddr = try self.growTextBlock(&decl.link, code.len, required_alignment); |
| 1030 | std.debug.warn("growing {} from 0x{x} to 0x{x}\n", .{ decl.name, local_sym.st_value, vaddr }); | 1030 | //std.debug.warn("growing {} from 0x{x} to 0x{x}\n", .{ decl.name, local_sym.st_value, vaddr }); |
| 1031 | if (vaddr != local_sym.st_value) { | 1031 | if (vaddr != local_sym.st_value) { |
| 1032 | local_sym.st_value = vaddr; | 1032 | local_sym.st_value = vaddr; |
| 1033 | | 1033 | |
| 1034 | std.debug.warn(" (writing new offset table entry)\n", .{}); | 1034 | //std.debug.warn(" (writing new offset table entry)\n", .{}); |
| 1035 | self.offset_table.items[decl.link.offset_table_index] = vaddr; | 1035 | self.offset_table.items[decl.link.offset_table_index] = vaddr; |
| 1036 | try self.writeOffsetTableEntry(decl.link.offset_table_index); | 1036 | try self.writeOffsetTableEntry(decl.link.offset_table_index); |
| 1037 | } | 1037 | } |
| ... | @@ -1049,7 +1049,7 @@ pub const ElfFile = struct { | ... | @@ -1049,7 +1049,7 @@ pub const ElfFile = struct { |
| 1049 | const decl_name = mem.spanZ(decl.name); | 1049 | const decl_name = mem.spanZ(decl.name); |
| 1050 | const name_str_index = try self.makeString(decl_name); | 1050 | const name_str_index = try self.makeString(decl_name); |
| 1051 | const vaddr = try self.allocateTextBlock(&decl.link, code.len, required_alignment); | 1051 | const vaddr = try self.allocateTextBlock(&decl.link, code.len, required_alignment); |
| 1052 | std.debug.warn("allocated text block for {} at 0x{x}\n", .{ decl_name, vaddr }); | 1052 | //std.debug.warn("allocated text block for {} at 0x{x}\n", .{ decl_name, vaddr }); |
| 1053 | errdefer self.freeTextBlock(&decl.link); | 1053 | errdefer self.freeTextBlock(&decl.link); |
| 1054 | | 1054 | |
| 1055 | local_sym.* = .{ | 1055 | local_sym.* = .{ |