mirror of
https://github.com/ziglang/zig.git
synced 2026-01-04 12:33:19 +00:00
elf: fix .eh_frame calc in relocatable mode
This commit is contained in:
parent
e99818c602
commit
89db24ec6d
@ -5860,6 +5860,10 @@ pub const Ref = struct {
|
||||
index: u32,
|
||||
file: u32,
|
||||
|
||||
pub fn eql(ref: Ref, other: Ref) bool {
|
||||
return ref.index == other.index and ref.file == other.file;
|
||||
}
|
||||
|
||||
pub fn format(
|
||||
ref: Ref,
|
||||
comptime unused_fmt_string: []const u8,
|
||||
|
||||
@ -145,10 +145,10 @@ pub const Cie = struct {
|
||||
if (cie_rel.r_addend != other_rel.r_addend) return false;
|
||||
|
||||
const cie_object = elf_file.file(cie.file_index).?.object;
|
||||
const cie_ref = cie_object.resolveSymbol(cie_rel.r_sym(), elf_file);
|
||||
const other_object = elf_file.file(other.file_index).?.object;
|
||||
const cie_sym = cie_object.symbols.items[cie_rel.r_sym()];
|
||||
const other_sym = other_object.symbols.items[other_rel.r_sym()];
|
||||
if (!std.mem.eql(u8, std.mem.asBytes(&cie_sym), std.mem.asBytes(&other_sym))) return false;
|
||||
const other_ref = other_object.resolveSymbol(other_rel.r_sym(), elf_file);
|
||||
if (!cie_ref.eql(other_ref)) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user