mirror of
https://github.com/ziglang/zig.git
synced 2026-02-20 16:24:51 +00:00
zld: differentiate between static and global in stabs
This commit is contained in:
parent
717d382871
commit
3b7c9dd6bd
@ -399,8 +399,13 @@ pub fn parseDebugInfo(self: *Object) !void {
|
||||
}
|
||||
} else null;
|
||||
|
||||
// TODO How do we work out static, global, local?
|
||||
const tag: Stab.Tag = if (size == null) .global else .function;
|
||||
const tag: Stab.Tag = tag: {
|
||||
if (size != null) break :tag .function;
|
||||
switch (sym.tag) {
|
||||
.weak, .strong => break :tag .global,
|
||||
else => break :tag .static,
|
||||
}
|
||||
};
|
||||
try self.stabs.append(self.allocator, .{
|
||||
.tag = tag,
|
||||
.size = size,
|
||||
|
||||
@ -2519,7 +2519,16 @@ fn writeDebugInfo(self: *Zld) !void {
|
||||
.n_value = stab.size.?,
|
||||
});
|
||||
},
|
||||
else => {
|
||||
.global => {
|
||||
try stabs.append(.{
|
||||
.n_strx = sym.inner.n_strx,
|
||||
.n_type = macho.N_GSYM,
|
||||
.n_sect = 0,
|
||||
.n_desc = 0,
|
||||
.n_value = 0,
|
||||
});
|
||||
},
|
||||
.static => {
|
||||
try stabs.append(.{
|
||||
.n_strx = sym.inner.n_strx,
|
||||
.n_type = macho.N_STSYM,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user