aboutsummaryrefslogtreecommitdiff
path: root/src/link/MachO/UnwindInfo.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2023-08-27 07:31:29 +0200
committerJakub Konka <kubkon@jakubkonka.com>2023-08-29 11:39:35 +0200
commit42e0850d78e63fcc602dd0e167ac90dfb3cfec02 (patch)
tree62cbed417608fcffc6c7ef4f3bda6045d067f00a /src/link/MachO/UnwindInfo.zig
parent84853c5c56e87a7ee6c5392756b0773b650d283c (diff)
downloadzig-42e0850d78e63fcc602dd0e167ac90dfb3cfec02.tar.gz
zig-42e0850d78e63fcc602dd0e167ac90dfb3cfec02.zip
macho: save indexes to all sections of interest
Diffstat (limited to 'src/link/MachO/UnwindInfo.zig')
-rw-r--r--src/link/MachO/UnwindInfo.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/link/MachO/UnwindInfo.zig b/src/link/MachO/UnwindInfo.zig
index 53d7c149be..3cd72fd64e 100644
--- a/src/link/MachO/UnwindInfo.zig
+++ b/src/link/MachO/UnwindInfo.zig
@@ -204,7 +204,7 @@ pub fn deinit(info: *UnwindInfo) void {
}
pub fn scanRelocs(zld: *Zld) !void {
- if (zld.getSectionByName("__TEXT", "__unwind_info") == null) return;
+ if (zld.unwind_info_section_index == null) return;
const cpu_arch = zld.options.target.cpu.arch;
for (zld.objects.items, 0..) |*object, object_id| {
@@ -233,7 +233,7 @@ pub fn scanRelocs(zld: *Zld) !void {
}
pub fn collect(info: *UnwindInfo, zld: *Zld) !void {
- if (zld.getSectionByName("__TEXT", "__unwind_info") == null) return;
+ if (zld.unwind_info_section_index == null) return;
const cpu_arch = zld.options.target.cpu.arch;
@@ -551,7 +551,7 @@ fn collectPersonalityFromDwarf(
}
pub fn calcSectionSize(info: UnwindInfo, zld: *Zld) !void {
- const sect_id = zld.getSectionByName("__TEXT", "__unwind_info") orelse return;
+ const sect_id = zld.unwind_info_section_index orelse return;
const sect = &zld.sections.items(.header)[sect_id];
sect.@"align" = 2;
sect.size = info.calcRequiredSize();
@@ -570,7 +570,7 @@ fn calcRequiredSize(info: UnwindInfo) usize {
}
pub fn write(info: *UnwindInfo, zld: *Zld) !void {
- const sect_id = zld.getSectionByName("__TEXT", "__unwind_info") orelse return;
+ const sect_id = zld.unwind_info_section_index orelse return;
const sect = &zld.sections.items(.header)[sect_id];
const seg_id = zld.sections.items(.segment_index)[sect_id];
const seg = zld.segments.items[seg_id];