| ... | @@ -23,7 +23,7 @@ segment_cmds: std.ArrayListUnmanaged(macho.segment_command_64) = std.ArrayListUn | ... | @@ -23,7 +23,7 @@ segment_cmds: std.ArrayListUnmanaged(macho.segment_command_64) = std.ArrayListUn |
| 23 | | 23 | |
| 24 | /// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. | 24 | /// Stored in native-endian format, depending on target endianness needs to be bswapped on read/write. |
| 25 | /// Same order as in the file. | 25 | /// Same order as in the file. |
| 26 | sections: std.ArrayListUnmanaged(macho.@"section_64") = std.ArrayListUnmanaged(macho.@"section_64"){}, | 26 | sections: std.ArrayListUnmanaged(macho.section_64) = std.ArrayListUnmanaged(macho.section_64){}, |
| 27 | | 27 | |
| 28 | entry_addr: ?u64 = null, | 28 | entry_addr: ?u64 = null, |
| 29 | | 29 | |
| ... | @@ -117,9 +117,8 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Mach | ... | @@ -117,9 +117,8 @@ fn createFile(allocator: *Allocator, file: fs.File, options: link.Options) !Mach |
| 117 | } | 117 | } |
| 118 | | 118 | |
| 119 | fn makeString(self: *MachO, comptime bytes: []const u8) [16]u8 { | 119 | fn makeString(self: *MachO, comptime bytes: []const u8) [16]u8 { |
| 120 | if (bytes.len > 16) @compileError("MachO segment/section name too long"); | | |
| 121 | | | |
| 122 | var buf: [16]u8 = undefined; | 120 | var buf: [16]u8 = undefined; |
| | 121 | if (bytes.len > buf.len) @compileError("MachO segment/section name too long"); |
| 123 | mem.copy(u8, buf[0..], bytes); | 122 | mem.copy(u8, buf[0..], bytes); |
| 124 | return buf; | 123 | return buf; |
| 125 | } | 124 | } |
| ... | @@ -194,7 +193,7 @@ pub fn flush(self: *MachO, module: *Module) !void { | ... | @@ -194,7 +193,7 @@ pub fn flush(self: *MachO, module: *Module) !void { |
| 194 | | 193 | |
| 195 | pub fn deinit(self: *MachO) void { | 194 | pub fn deinit(self: *MachO) void { |
| 196 | self.segment_cmds.deinit(self.base.allocator); | 195 | self.segment_cmds.deinit(self.base.allocator); |
| 197 | self.@"sections".deinit(self.base.allocator); | 196 | self.sections.deinit(self.base.allocator); |
| 198 | } | 197 | } |
| 199 | | 198 | |
| 200 | pub fn allocateDeclIndexes(self: *MachO, decl: *Module.Decl) !void {} | 199 | pub fn allocateDeclIndexes(self: *MachO, decl: *Module.Decl) !void {} |