| ... | ... | @@ -6413,10 +6413,10 @@ fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void { |
| 6413 | 6413 | const addr_lock = self.register_manager.lockRegAssumeUnused(addr_reg); |
| 6414 | 6414 | defer self.register_manager.unlockReg(addr_lock); |
| 6415 | 6415 | |
| 6416 | const mod = self.bin_file.options.module.?; |
| 6417 | const lazy_sym = link.File.LazySymbol.initDecl(.const_data, null, mod); |
| 6416 | 6418 | if (self.bin_file.cast(link.File.Elf)) |elf_file| { |
| 6417 | | const atom_index = try elf_file.getOrCreateAtomForLazySymbol( |
| 6418 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 6419 | | ); |
| 6419 | const atom_index = try elf_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 6420 | 6420 | const atom = elf_file.getAtom(atom_index); |
| 6421 | 6421 | _ = try atom.getOrCreateOffsetTableEntry(elf_file); |
| 6422 | 6422 | const got_addr = atom.getOffsetTableAddress(elf_file); |
| ... | ... | @@ -6426,15 +6426,11 @@ fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void { |
| 6426 | 6426 | Memory.sib(.qword, .{ .base = .{ .reg = .ds }, .disp = @intCast(i32, got_addr) }), |
| 6427 | 6427 | ); |
| 6428 | 6428 | } else if (self.bin_file.cast(link.File.Coff)) |coff_file| { |
| 6429 | | const atom_index = try coff_file.getOrCreateAtomForLazySymbol( |
| 6430 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 6431 | | ); |
| 6429 | const atom_index = try coff_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 6432 | 6430 | const sym_index = coff_file.getAtom(atom_index).getSymbolIndex().?; |
| 6433 | 6431 | try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index }); |
| 6434 | 6432 | } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { |
| 6435 | | const atom_index = try macho_file.getOrCreateAtomForLazySymbol( |
| 6436 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 6437 | | ); |
| 6433 | const atom_index = try macho_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 6438 | 6434 | const sym_index = macho_file.getAtom(atom_index).getSymbolIndex().?; |
| 6439 | 6435 | try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index }); |
| 6440 | 6436 | } else { |
| ... | ... | @@ -8498,10 +8494,10 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { |
| 8498 | 8494 | const addr_lock = self.register_manager.lockRegAssumeUnused(addr_reg); |
| 8499 | 8495 | defer self.register_manager.unlockReg(addr_lock); |
| 8500 | 8496 | |
| 8497 | const mod = self.bin_file.options.module.?; |
| 8498 | const lazy_sym = link.File.LazySymbol.initDecl(.const_data, null, mod); |
| 8501 | 8499 | if (self.bin_file.cast(link.File.Elf)) |elf_file| { |
| 8502 | | const atom_index = try elf_file.getOrCreateAtomForLazySymbol( |
| 8503 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 8504 | | ); |
| 8500 | const atom_index = try elf_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 8505 | 8501 | const atom = elf_file.getAtom(atom_index); |
| 8506 | 8502 | _ = try atom.getOrCreateOffsetTableEntry(elf_file); |
| 8507 | 8503 | const got_addr = atom.getOffsetTableAddress(elf_file); |
| ... | ... | @@ -8511,15 +8507,11 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void { |
| 8511 | 8507 | Memory.sib(.qword, .{ .base = .{ .reg = .ds }, .disp = @intCast(i32, got_addr) }), |
| 8512 | 8508 | ); |
| 8513 | 8509 | } else if (self.bin_file.cast(link.File.Coff)) |coff_file| { |
| 8514 | | const atom_index = try coff_file.getOrCreateAtomForLazySymbol( |
| 8515 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 8516 | | ); |
| 8510 | const atom_index = try coff_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 8517 | 8511 | const sym_index = coff_file.getAtom(atom_index).getSymbolIndex().?; |
| 8518 | 8512 | try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index }); |
| 8519 | 8513 | } else if (self.bin_file.cast(link.File.MachO)) |macho_file| { |
| 8520 | | const atom_index = try macho_file.getOrCreateAtomForLazySymbol( |
| 8521 | | .{ .kind = .const_data, .ty = Type.anyerror }, |
| 8522 | | ); |
| 8514 | const atom_index = try macho_file.getOrCreateAtomForLazySymbol(lazy_sym); |
| 8523 | 8515 | const sym_index = macho_file.getAtom(atom_index).getSymbolIndex().?; |
| 8524 | 8516 | try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index }); |
| 8525 | 8517 | } else { |