mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
objcopy: check both global and local when remapping
This commit is contained in:
parent
344a21b14f
commit
49637f5372
@ -1179,13 +1179,10 @@ fn ElfFile(comptime is_64: bool) type {
|
|||||||
@memcpy(data, src_data);
|
@memcpy(data, src_data);
|
||||||
|
|
||||||
const defs = @as([*]elf.Verdef, @ptrCast(data))[0 .. @as(usize, @intCast(src.sh_size)) / @sizeOf(elf.Verdef)];
|
const defs = @as([*]elf.Verdef, @ptrCast(data))[0 .. @as(usize, @intCast(src.sh_size)) / @sizeOf(elf.Verdef)];
|
||||||
for (defs) |*def| {
|
for (defs) |*def| switch (def.ndx) {
|
||||||
// Original author of this next line had elf.SHN_UNDEF
|
.LOCAL, .GLOBAL => {},
|
||||||
// here which does not make sense given that this field
|
else => def.ndx = @enumFromInt(sections_update[src.sh_info].remap_idx),
|
||||||
// is elf.VER_NDX
|
};
|
||||||
if (def.ndx != .LOCAL)
|
|
||||||
def.ndx = @enumFromInt(sections_update[src.sh_info].remap_idx);
|
|
||||||
}
|
|
||||||
|
|
||||||
break :dst_data data;
|
break :dst_data data;
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user