Update src/codegen.zig

Co-authored-by: Andrew Kelley <andrew@ziglang.org>
master
Jakub Konka 2020-11-27 20:31:26 +01:00 committed by GitHub
parent ebb2f20815
commit 02baaac506
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2584,7 +2584,7 @@ fn Function(comptime arch: std.Target.Cpu.Arch) type {
},
.register => return self.fail(src, "TODO implement genSetReg for aarch64 {}", .{mcv}),
.memory => |addr| {
if (self.bin_file.cast(link.File.MachO)) |macho_file| {
if (self.bin_file.options.pie) {
// For MachO, the binary, with the exception of object files, has to be a PIE.
// Therefore we cannot load an absolute address.
// Instead, we need to make use of PC-relative addressing.