diff options
Diffstat (limited to 'src/link/MachO/Object.zig')
| -rw-r--r-- | src/link/MachO/Object.zig | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/src/link/MachO/Object.zig b/src/link/MachO/Object.zig index 011aca06c3..f000119edf 100644 --- a/src/link/MachO/Object.zig +++ b/src/link/MachO/Object.zig @@ -435,6 +435,8 @@ const TextBlockParser = struct { .references = std.AutoArrayHashMap(u32, void).init(self.allocator), .code = try self.allocator.dupe(u8, code), .relocs = std.ArrayList(Relocation).init(self.allocator), + .rebases = std.ArrayList(u64).init(self.allocator), + .tlv_offsets = std.ArrayList(u64).init(self.allocator), .size = size, .alignment = self.section.@"align", }; @@ -444,18 +446,6 @@ const TextBlockParser = struct { try self.object.parseRelocs(self.zld, relocs, block, start_addr); } - const is_zerofill = blk: { - const tseg = self.zld.load_commands.items[self.match.seg].Segment; - const tsect = tseg.sections.items[self.match.sect]; - const tsect_type = sectionType(tsect); - break :blk tsect_type == macho.S_ZEROFILL or - tsect_type == macho.S_THREAD_LOCAL_ZEROFILL or - tsect_type == macho.S_THREAD_LOCAL_VARIABLES; - }; - if (is_zerofill) { - mem.set(u8, block.code, 0); - } - self.index += 1; return block; @@ -589,6 +579,8 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { .references = std.AutoArrayHashMap(u32, void).init(self.allocator), .code = try self.allocator.dupe(u8, code), .relocs = std.ArrayList(Relocation).init(self.allocator), + .rebases = std.ArrayList(u64).init(self.allocator), + .tlv_offsets = std.ArrayList(u64).init(self.allocator), .size = sect.size, .alignment = sect.@"align", }; @@ -597,18 +589,6 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { try self.parseRelocs(zld, relocs, block, 0); } - const is_zerofill = blk: { - const tseg = zld.load_commands.items[match.seg].Segment; - const tsect = tseg.sections.items[match.sect]; - const tsect_type = sectionType(tsect); - break :blk tsect_type == macho.S_ZEROFILL or - tsect_type == macho.S_THREAD_LOCAL_ZEROFILL or - tsect_type == macho.S_THREAD_LOCAL_VARIABLES; - }; - if (is_zerofill) { - mem.set(u8, block.code, 0); - } - if (zld.blocks.getPtr(match)) |last| { last.*.next = block; block.prev = last.*; |
