aboutsummaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-04-29 19:31:34 -0400
committerJacob Young <jacobly0@users.noreply.github.com>2023-05-01 19:22:52 -0400
commitf37ca3fa7370c501c630c53b370fecdeb313e3be (patch)
tree5025974bf1873d55e6281a15f31fae016a15a922 /src/arch
parent10a4c2269d110d636e7817677fb50c6f418bff34 (diff)
downloadzig-f37ca3fa7370c501c630c53b370fecdeb313e3be.tar.gz
zig-f37ca3fa7370c501c630c53b370fecdeb313e3be.zip
link: cleanup lazy alignment
This gets the alignment from the code that creates a lazy symbol instead of guessing it at every use.
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86_64/CodeGen.zig6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/arch/x86_64/CodeGen.zig b/src/arch/x86_64/CodeGen.zig
index 7f0d07cf9b..eee89e9ded 100644
--- a/src/arch/x86_64/CodeGen.zig
+++ b/src/arch/x86_64/CodeGen.zig
@@ -6416,7 +6416,6 @@ fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void {
if (self.bin_file.cast(link.File.Elf)) |elf_file| {
const atom_index = try elf_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const atom = elf_file.getAtom(atom_index);
_ = try atom.getOrCreateOffsetTableEntry(elf_file);
@@ -6429,14 +6428,12 @@ fn airCmpLtErrorsLen(self: *Self, inst: Air.Inst.Index) !void {
} else if (self.bin_file.cast(link.File.Coff)) |coff_file| {
const atom_index = try coff_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const sym_index = coff_file.getAtom(atom_index).getSymbolIndex().?;
try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index });
} else if (self.bin_file.cast(link.File.MachO)) |macho_file| {
const atom_index = try macho_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const sym_index = macho_file.getAtom(atom_index).getSymbolIndex().?;
try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index });
@@ -8504,7 +8501,6 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void {
if (self.bin_file.cast(link.File.Elf)) |elf_file| {
const atom_index = try elf_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const atom = elf_file.getAtom(atom_index);
_ = try atom.getOrCreateOffsetTableEntry(elf_file);
@@ -8517,14 +8513,12 @@ fn airErrorName(self: *Self, inst: Air.Inst.Index) !void {
} else if (self.bin_file.cast(link.File.Coff)) |coff_file| {
const atom_index = try coff_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const sym_index = coff_file.getAtom(atom_index).getSymbolIndex().?;
try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index });
} else if (self.bin_file.cast(link.File.MachO)) |macho_file| {
const atom_index = try macho_file.getOrCreateAtomForLazySymbol(
.{ .kind = .const_data, .ty = Type.anyerror },
- 4, // dword alignment
);
const sym_index = macho_file.getAtom(atom_index).getSymbolIndex().?;
try self.genSetReg(addr_reg, Type.usize, .{ .lea_got = sym_index });