authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-11-28 15:01:05+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-01 10:49:31+01:00
log0ef3071db6827427e834475d8d111370cc25a924
tree2939e68bdb30e92ef369ba94f064144c47b74d66
parentc25b3593e726108cb7f208ef538df6979aeb41e1

lld: copy+rename to please the kernel


1 files changed, 3 insertions(+), 1 deletions(-)

src/link/MachO.zig+3-1
...@@ -852,9 +852,10 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {...@@ -852,9 +852,10 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
852 // Generate adhoc code signature852 // Generate adhoc code signature
853 var signature = CodeSignature.init(self.base.allocator);853 var signature = CodeSignature.init(self.base.allocator);
854 defer signature.deinit();854 defer signature.deinit();
855 const emit = self.base.options.emit.?;
855 try signature.calcAdhocSignatureFile(856 try signature.calcAdhocSignatureFile(
856 out_file,857 out_file,
857 self.base.options.emit.?.sub_path,858 emit.sub_path,
858 text_cmd,859 text_cmd,
859 code_sig,860 code_sig,
860 self.base.options.output_mode,861 self.base.options.output_mode,
...@@ -863,6 +864,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {...@@ -863,6 +864,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
863 defer self.base.allocator.free(buffer);864 defer self.base.allocator.free(buffer);
864 signature.write(buffer);865 signature.write(buffer);
865 try out_file.pwriteAll(buffer, code_sig.dataoff);866 try out_file.pwriteAll(buffer, code_sig.dataoff);
867 try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{});
866 }868 }
867 }869 }
868870