| ... | @@ -512,10 +512,10 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { | ... | @@ -512,10 +512,10 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { |
| 512 | const relocs = mem.bytesAsSlice(macho.relocation_info, raw_relocs); | 512 | const relocs = mem.bytesAsSlice(macho.relocation_info, raw_relocs); |
| 513 | | 513 | |
| 514 | // Is there any padding between symbols within the section? | 514 | // Is there any padding between symbols within the section? |
| 515 | const is_padded = self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0; | 515 | const is_splittable = self.header.?.flags & macho.MH_SUBSECTIONS_VIA_SYMBOLS != 0; |
| 516 | | 516 | |
| 517 | next: { | 517 | next: { |
| 518 | if (is_padded) blocks: { | 518 | if (is_splittable) blocks: { |
| 519 | const filtered_nlists = NlistWithIndex.filterInSection( | 519 | const filtered_nlists = NlistWithIndex.filterInSection( |
| 520 | sorted_nlists.items, | 520 | sorted_nlists.items, |
| 521 | sect_id + 1, | 521 | sect_id + 1, |
| ... | @@ -540,6 +540,8 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { | ... | @@ -540,6 +540,8 @@ pub fn parseTextBlocks(self: *Object, zld: *Zld) !void { |
| 540 | if (reg.file) |file| { | 540 | if (reg.file) |file| { |
| 541 | if (file != self) { | 541 | if (file != self) { |
| 542 | log.warn("deduping definition of {s} in {s}", .{ sym.name, self.name.? }); | 542 | log.warn("deduping definition of {s} in {s}", .{ sym.name, self.name.? }); |
| | 543 | block.deinit(self.allocator); |
| | 544 | self.allocator.destroy(block); |
| 543 | continue; | 545 | continue; |
| 544 | } | 546 | } |
| 545 | } | 547 | } |