macho: fix a sad typo in calculating the address of a TLV pointer

This commit is contained in:
Jakub Konka
2024-03-14 17:04:23 +01:00
parent 5193da3422
commit d565c5dfcd
2 changed files with 67 additions and 1 deletions

View File

@@ -532,7 +532,7 @@ pub const TlvPtrSection = struct {
pub fn getAddress(tlv: TlvPtrSection, index: Index, macho_file: *MachO) u64 {
assert(index < tlv.symbols.items.len);
const header = macho_file.sections.items(.header)[macho_file.tlv_ptr_sect_index.?];
return header.addr + index * @sizeOf(u64) * 3;
return header.addr + index * @sizeOf(u64);
}
pub fn size(tlv: TlvPtrSection) usize {