diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 4c7278da61..2c420fcde4 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -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| { diff --git a/src/link/MachO/relocatable.zig b/src/link/MachO/relocatable.zig index 5e96a4d88e..954cdfd5d5 100644 --- a/src/link/MachO/relocatable.zig +++ b/src/link/MachO/relocatable.zig @@ -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, + }); } }