diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-11-25 22:02:59 +0100 |
|---|---|---|
| committer | Jakub Konka <kubkon@jakubkonka.com> | 2020-11-26 11:50:09 +0100 |
| commit | 64eae8f39240109ce23c21e975c1d29191b4692a (patch) | |
| tree | 4a5bbbb6e06459889640b2d5ee5bbd08bef2a3d3 /src/codegen.zig | |
| parent | c749b78df50160bedae40f90765442dd1f49de3a (diff) | |
| download | zig-64eae8f39240109ce23c21e975c1d29191b4692a.tar.gz zig-64eae8f39240109ce23c21e975c1d29191b4692a.zip | |
stage2 macho: move PIE fixups to link file; fix tests
Diffstat (limited to 'src/codegen.zig')
| -rw-r--r-- | src/codegen.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/codegen.zig b/src/codegen.zig index 35443ba0b1..af91e7e909 100644 --- a/src/codegen.zig +++ b/src/codegen.zig @@ -2601,7 +2601,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { }).toU32()); // adr x28, #8 mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.adr(.x28, 8).toU32()); - try self.mod_fn.owner_decl.link.macho.addPieFixup(self.bin_file.allocator, .{ + try macho_file.pie_fixups.append(self.bin_file.allocator, .{ .address = addr, .start = self.code.items.len, .len = 4, @@ -2626,7 +2626,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { }).toU32()); // adr x28, #8 mem.writeIntLittle(u32, try self.code.addManyAsArray(4), Instruction.adr(.x28, 8).toU32()); - try self.mod_fn.owner_decl.link.macho.addPieFixup(self.bin_file.allocator, .{ + try macho_file.pie_fixups.append(self.bin_file.allocator, .{ .address = addr, .start = self.code.items.len, .len = 4, @@ -2838,7 +2838,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { // later in the linker. if (reg.id() == 0) { // %rax is special-cased try self.code.ensureCapacity(self.code.items.len + 5); - try self.mod_fn.owner_decl.link.macho.addPieFixup(self.bin_file.allocator, .{ + try macho_file.pie_fixups.append(self.bin_file.allocator, .{ .address = x, .start = self.code.items.len, .len = 5, @@ -2855,7 +2855,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type { try self.code.ensureCapacity(self.code.items.len + 10); // push %rax self.code.appendSliceAssumeCapacity(&[_]u8{0x50}); - try self.mod_fn.owner_decl.link.macho.addPieFixup(self.bin_file.allocator, .{ + try macho_file.pie_fixups.append(self.bin_file.allocator, .{ .address = x, .start = self.code.items.len, .len = 5, |
