mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 04:48:20 +00:00
macho: fix findFreeSpace start value
This commit is contained in:
parent
c89f4781bd
commit
ca1d03fe77
@ -1739,7 +1739,10 @@ fn detectAllocCollision(self: *MachO, segment: *const SegmentCommand, start: u64
|
||||
}
|
||||
|
||||
fn findFreeSpace(self: *MachO, segment: *const SegmentCommand, object_size: u64, min_alignment: u16) u64 {
|
||||
var start: u64 = if (parseAndCmpName(&segment.inner.segname, "__TEXT")) self.header_pad else 0;
|
||||
var start: u64 = if (parseAndCmpName(&segment.inner.segname, "__TEXT"))
|
||||
self.header_pad
|
||||
else
|
||||
segment.inner.fileoff;
|
||||
while (self.detectAllocCollision(segment, start, object_size)) |item_end| {
|
||||
start = mem.alignForwardGeneric(u64, item_end, min_alignment);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user