mirror of
https://github.com/ziglang/zig.git
synced 2024-11-27 23:52:31 +00:00
coff: treat vmaddr of 0 as unallocated when checking if resolvable
This commit is contained in:
parent
bee35fe3f0
commit
dd300d92e1
@ -492,8 +492,8 @@ fn growSection(self: *Coff, sect_id: u32, needed_size: u32) !void {
|
||||
|
||||
const sect_vm_capacity = self.allocatedVirtualSize(header.virtual_address);
|
||||
if (needed_size > sect_vm_capacity) {
|
||||
try self.growSectionVirtualMemory(sect_id, needed_size);
|
||||
self.markRelocsDirtyByAddress(header.virtual_address + needed_size);
|
||||
try self.growSectionVirtualMemory(sect_id, needed_size);
|
||||
}
|
||||
|
||||
header.virtual_size = @max(header.virtual_size, needed_size);
|
||||
|
@ -73,7 +73,8 @@ pub fn getTargetAddress(self: Relocation, coff_file: *const Coff) ?u32 {
|
||||
|
||||
/// Returns true if and only if the reloc is dirty AND the target address is available.
|
||||
pub fn isResolvable(self: Relocation, coff_file: *Coff) bool {
|
||||
_ = self.getTargetAddress(coff_file) orelse return false;
|
||||
const addr = self.getTargetAddress(coff_file) orelse return false;
|
||||
if (addr == 0) return false;
|
||||
return self.dirty;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user