zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 05b15e8bdb0f402fa2acea113ecbbe171f4d02bf (tree)
parent fc517bd01c8c60290e903e58f1f567b065ae72a0
Author: Vadym Prodan <vprodan@proton.me>
Date:   Sat, 10 Jan 2026 01:23:54 +0100

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

Diffstat:
Msrc/link/MachO.zig | 4+++-
Msrc/link/MachO/relocatable.zig | 4+++-
2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 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 @@ -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, + }); } }