link/MachO: Add correct section flags (S_COALESCED, S_ATTR_NO_TOC,

S_ATTR_STRIP_STATIC_SYMS, S_ATTR_LIVE_SUPPORT) to __eh_frame section
  to match platform conventions
This commit is contained in:
Vadym Prodan 2026-01-10 01:23:54 +01:00 committed by Vadym Prodan
parent fc517bd01c
commit 05b15e8bdb
2 changed files with 6 additions and 2 deletions

View file

@ -1707,7 +1707,9 @@ fn initSyntheticSections(self: *MachO) !void {
} else false;
if (needs_eh_frame) {
assert(needs_unwind_info);
self.eh_frame_sect_index = try self.addSection("__TEXT", "__eh_frame", .{});
self.eh_frame_sect_index = try self.addSection("__TEXT", "__eh_frame", .{
.flags = macho.S_COALESCED | macho.S_ATTR_NO_TOC | macho.S_ATTR_STRIP_STATIC_SYMS | macho.S_ATTR_LIVE_SUPPORT,
});
}
if (self.getInternalObject()) |obj| {

View file

@ -289,7 +289,9 @@ fn initOutputSections(macho_file: *MachO) !void {
} else false;
if (needs_eh_frame) {
assert(needs_unwind_info);
macho_file.eh_frame_sect_index = try macho_file.addSection("__TEXT", "__eh_frame", .{});
macho_file.eh_frame_sect_index = try macho_file.addSection("__TEXT", "__eh_frame", .{
.flags = std.macho.S_COALESCED | std.macho.S_ATTR_NO_TOC | std.macho.S_ATTR_STRIP_STATIC_SYMS | std.macho.S_ATTR_LIVE_SUPPORT,
});
}
}