authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-03 09:25:07+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-02-03 09:28:37+01:00
logaa1aa9886333e8b260901572142a227e5544f4df
tree856d938cf054b256e7c2bd72fd833ab67df35e7f
parentdc6db3b30911a09890d6b5674c72a9db5a52e050

macho: fix remaining references to Atom.value


3 files changed, 7 insertions(+), 7 deletions(-)

src/link/MachO/Relocation.zig+1-1
......@@ -22,7 +22,7 @@ pub fn getTargetAtom(rel: Relocation, macho_file: *MachO) *Atom {
2222
2323pub fn getTargetAddress(rel: Relocation, macho_file: *MachO) u64 {
2424 return switch (rel.tag) {
25 .local => rel.getTargetAtom(macho_file).value,
25 .local => rel.getTargetAtom(macho_file).getAddress(macho_file),
2626 .@"extern" => rel.getTargetSymbol(macho_file).getAddress(.{}, macho_file),
2727 };
2828}
src/link/MachO/UnwindInfo.zig+2-2
......@@ -490,12 +490,12 @@ pub const Record = struct {
490490
491491 pub fn getAtomAddress(rec: Record, macho_file: *MachO) u64 {
492492 const atom = rec.getAtom(macho_file);
493 return atom.value + rec.atom_offset;
493 return atom.getAddress(macho_file) + rec.atom_offset;
494494 }
495495
496496 pub fn getLsdaAddress(rec: Record, macho_file: *MachO) u64 {
497497 const lsda = rec.getLsdaAtom(macho_file) orelse return 0;
498 return lsda.value + rec.lsda_offset;
498 return lsda.getAddress(macho_file) + rec.lsda_offset;
499499 }
500500
501501 pub fn format(
src/link/MachO/eh_frame.zig+4-4
......@@ -416,7 +416,7 @@ pub fn write(macho_file: *MachO, buffer: []u8) void {
416416 {
417417 const offset = fde.out_offset + 8;
418418 const saddr = sect.addr + offset;
419 const taddr = fde.getAtom(macho_file).value;
419 const taddr = fde.getAtom(macho_file).getAddress(macho_file);
420420 std.mem.writeInt(
421421 i64,
422422 buffer[offset..][0..8],
......@@ -428,7 +428,7 @@ pub fn write(macho_file: *MachO, buffer: []u8) void {
428428 if (fde.getLsdaAtom(macho_file)) |atom| {
429429 const offset = fde.out_offset + fde.lsda_ptr_offset;
430430 const saddr = sect.addr + offset;
431 const taddr = atom.value + fde.lsda_offset;
431 const taddr = atom.getAddress(macho_file) + fde.lsda_offset;
432432 switch (fde.getCie(macho_file).lsda_size.?) {
433433 .p32 => std.mem.writeInt(
434434 i32,
......@@ -501,7 +501,7 @@ pub fn writeRelocs(macho_file: *MachO, code: []u8, relocs: *std.ArrayList(macho.
501501 {
502502 const offset = fde.out_offset + 8;
503503 const saddr = sect.addr + offset;
504 const taddr = fde.getAtom(macho_file).value;
504 const taddr = fde.getAtom(macho_file).getAddress(macho_file);
505505 std.mem.writeInt(
506506 i64,
507507 code[offset..][0..8],
......@@ -513,7 +513,7 @@ pub fn writeRelocs(macho_file: *MachO, code: []u8, relocs: *std.ArrayList(macho.
513513 if (fde.getLsdaAtom(macho_file)) |atom| {
514514 const offset = fde.out_offset + fde.lsda_ptr_offset;
515515 const saddr = sect.addr + offset;
516 const taddr = atom.value + fde.lsda_offset;
516 const taddr = atom.getAddress(macho_file) + fde.lsda_offset;
517517 switch (fde.getCie(macho_file).lsda_size.?) {
518518 .p32 => std.mem.writeInt(
519519 i32,