authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-10-05 05:21:48+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2024-10-05 05:21:48+02:00
loge6fd01a9493bed097271f07cd2493b51df51c98d
treecdd9eb331bce7665ba0272d3114c9661d086dfb1
parentcfd3bcffec997a18521f685738e4dc7eef940422
parent64b6a4ff7731ac70556081500b0a615b9f4a42a1
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #21595 from alexrp/objcopy-seg-paddr

`objcopy`: Use `p_paddr` from `PT_LOAD` even if zero.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/compiler/objcopy.zig+1-1
...@@ -456,7 +456,7 @@ const BinaryElfOutput = struct {...@@ -456,7 +456,7 @@ const BinaryElfOutput = struct {
456 if (phdr.p_type == elf.PT_LOAD) {456 if (phdr.p_type == elf.PT_LOAD) {
457 const newSegment = try allocator.create(BinaryElfSegment);457 const newSegment = try allocator.create(BinaryElfSegment);
458458
459 newSegment.physicalAddress = if (phdr.p_paddr != 0) phdr.p_paddr else phdr.p_vaddr;459 newSegment.physicalAddress = phdr.p_paddr;
460 newSegment.virtualAddress = phdr.p_vaddr;460 newSegment.virtualAddress = phdr.p_vaddr;
461 newSegment.fileSize = @intCast(phdr.p_filesz);461 newSegment.fileSize = @intCast(phdr.p_filesz);
462 newSegment.elfOffset = phdr.p_offset;462 newSegment.elfOffset = phdr.p_offset;