| author | |
| committer | |
| log | 3b7c9dd6bd9a921b8104894d7bdbb55eca90e056 |
| tree | 37d760d902c3b3dea5ad73d3c8508ecc5bfe2ded |
| parent | 717d38287144e3b5d8210c609092487ba5d751a5 |
2 files changed, 17 insertions(+), 3 deletions(-)
src/link/MachO/Object.zig+7-2| ... | ... | @@ -399,8 +399,13 @@ pub fn parseDebugInfo(self: *Object) !void { |
| 399 | 399 | } |
| 400 | 400 | } else null; |
| 401 | 401 | |
| 402 | // TODO How do we work out static, global, local? | |
| 403 | const tag: Stab.Tag = if (size == null) .global else .function; | |
| 402 | const tag: Stab.Tag = tag: { | |
| 403 | if (size != null) break :tag .function; | |
| 404 | switch (sym.tag) { | |
| 405 | .weak, .strong => break :tag .global, | |
| 406 | else => break :tag .static, | |
| 407 | } | |
| 408 | }; | |
| 404 | 409 | try self.stabs.append(self.allocator, .{ |
| 405 | 410 | .tag = tag, |
| 406 | 411 | .size = size, |
src/link/MachO/Zld.zig+10-1| ... | ... | @@ -2519,7 +2519,16 @@ fn writeDebugInfo(self: *Zld) !void { |
| 2519 | 2519 | .n_value = stab.size.?, |
| 2520 | 2520 | }); |
| 2521 | 2521 | }, |
| 2522 | else => { | |
| 2522 | .global => { | |
| 2523 | try stabs.append(.{ | |
| 2524 | .n_strx = sym.inner.n_strx, | |
| 2525 | .n_type = macho.N_GSYM, | |
| 2526 | .n_sect = 0, | |
| 2527 | .n_desc = 0, | |
| 2528 | .n_value = 0, | |
| 2529 | }); | |
| 2530 | }, | |
| 2531 | .static => { | |
| 2523 | 2532 | try stabs.append(.{ |
| 2524 | 2533 | .n_strx = sym.inner.n_strx, |
| 2525 | 2534 | .n_type = macho.N_STSYM, |