Skip to content

Commit

Permalink
Elf.Atom: fix truncated dyn abs relocs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobly0 committed Dec 15, 2024
1 parent d5c2f52 commit 7b14507
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/link/Elf/Atom.zig
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ fn resolveDynAbsReloc(
.copyrel,
.cplt,
.none,
=> try writer.writeInt(i32, @as(i32, @truncate(S + A)), .little),
=> try writer.writeInt(i64, S + A, .little),

.dyn_copyrel => {
if (is_writeable or elf_file.z_nocopyreloc) {
Expand All @@ -739,7 +739,7 @@ fn resolveDynAbsReloc(
});
try applyDynamicReloc(A, elf_file, writer);
} else {
try writer.writeInt(i32, @as(i32, @truncate(S + A)), .little);
try writer.writeInt(i64, S + A, .little);
}
},

Expand All @@ -754,7 +754,7 @@ fn resolveDynAbsReloc(
});
try applyDynamicReloc(A, elf_file, writer);
} else {
try writer.writeInt(i32, @as(i32, @truncate(S + A)), .little);
try writer.writeInt(i64, S + A, .little);
}
},

Expand Down

0 comments on commit 7b14507

Please sign in to comment.