authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-18 15:39:01+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2021-07-18 15:39:01+02:00
loge0b53ad3c99b8f38d2fdba7b9aa6bf3e638dbeb9
tree37698b271310e0f1f63a531f9e00706a9f5aefa1
parent2828cd2983446b116dc8d543ca5e209e361f39d0

macho: clean up imports


1 files changed, 16 insertions(+), 15 deletions(-)

src/link/MachO.zig+16-15
......@@ -1,35 +1,36 @@
11const MachO = @This();
22
33const std = @import("std");
4const Allocator = std.mem.Allocator;
4const build_options = @import("build_options");
55const assert = std.debug.assert;
66const fmt = std.fmt;
77const fs = std.fs;
88const log = std.log.scoped(.link);
99const macho = std.macho;
10const codegen = @import("../codegen.zig");
11const aarch64 = @import("../codegen/aarch64.zig");
1210const math = std.math;
1311const mem = std.mem;
1412const meta = std.meta;
1513
14const aarch64 = @import("../codegen/aarch64.zig");
1615const bind = @import("MachO/bind.zig");
17const trace = @import("../tracy.zig").trace;
18const build_options = @import("build_options");
19const Module = @import("../Module.zig");
20const Compilation = @import("../Compilation.zig");
16const codegen = @import("../codegen.zig");
17const commands = @import("MachO/commands.zig");
2118const link = @import("../link.zig");
22const File = link.File;
23const Cache = @import("../Cache.zig");
2419const target_util = @import("../target.zig");
20const trace = @import("../tracy.zig").trace;
2521
22const Allocator = mem.Allocator;
23const Cache = @import("../Cache.zig");
24const CodeSignature = @import("MachO/CodeSignature.zig");
25const Compilation = @import("../Compilation.zig");
2626const DebugSymbols = @import("MachO/DebugSymbols.zig");
27const LoadCommand = commands.LoadCommand;
28const Module = @import("../Module.zig");
29const File = link.File;
2730const Trie = @import("MachO/Trie.zig");
28const CodeSignature = @import("MachO/CodeSignature.zig");
31const SegmentCommand = commands.SegmentCommand;
2932const Zld = @import("MachO/Zld.zig");
3033
31usingnamespace @import("MachO/commands.zig");
32
3334pub const base_tag: File.Tag = File.Tag.macho;
3435
3536base: File,
......@@ -1841,7 +1842,7 @@ pub fn populateMissingMetadata(self: *MachO) !void {
18411842 @sizeOf(macho.dylinker_command) + mem.lenZ(DEFAULT_DYLD_PATH),
18421843 @sizeOf(u64),
18431844 ));
1844 var dylinker_cmd = emptyGenericCommandWithData(macho.dylinker_command{
1845 var dylinker_cmd = commands.emptyGenericCommandWithData(macho.dylinker_command{
18451846 .cmd = macho.LC_LOAD_DYLINKER,
18461847 .cmdsize = cmdsize,
18471848 .name = @sizeOf(macho.dylinker_command),
......@@ -1855,7 +1856,7 @@ pub fn populateMissingMetadata(self: *MachO) !void {
18551856 if (self.libsystem_cmd_index == null) {
18561857 self.libsystem_cmd_index = @intCast(u16, self.load_commands.items.len);
18571858
1858 var dylib_cmd = try createLoadDylibCommand(self.base.allocator, mem.spanZ(LIB_SYSTEM_PATH), 2, 0, 0);
1859 var dylib_cmd = try commands.createLoadDylibCommand(self.base.allocator, mem.spanZ(LIB_SYSTEM_PATH), 2, 0, 0);
18591860 errdefer dylib_cmd.deinit(self.base.allocator);
18601861
18611862 try self.load_commands.append(self.base.allocator, .{ .Dylib = dylib_cmd });
......@@ -3105,7 +3106,7 @@ fn writeLoadCommands(self: *MachO) !void {
31053106
31063107/// Writes Mach-O file header.
31073108fn writeHeader(self: *MachO) !void {
3108 var header = emptyHeader(.{
3109 var header = commands.emptyHeader(.{
31093110 .flags = macho.MH_NOUNDEFS | macho.MH_DYLDLINK | macho.MH_PIE | macho.MH_TWOLEVEL,
31103111 });
31113112