Skip to content

Commit

Permalink
macho: rename visibility.linkage to visibility.hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Dec 10, 2023
1 parent 75c17e2 commit 2c97ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/MachO/Object.zig
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ pub fn resolveSymbols(self: *Object, macho_file: *MachO) void {
// Regardless of who the winner is, we still merge symbol visibility here.
if (nlist.pext() or (nlist.weakDef() and nlist.weakRef()) or self.hidden) {
if (symbol.visibility != .global) {
symbol.visibility = .linkage;
symbol.visibility = .hidden;
}
} else {
symbol.visibility = .global;
Expand Down
4 changes: 2 additions & 2 deletions src/MachO/Symbol.zig
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ pub fn setOutputSym(symbol: Symbol, macho_file: *MachO, out: *macho.nlist_64) vo
out.n_value = symbol.getAddress(.{}, macho_file);

switch (symbol.visibility) {
.linkage => out.n_type |= macho.N_PEXT,
.hidden => out.n_type |= macho.N_PEXT,
else => {},
}
} else if (symbol.flags.@"export") {
Expand Down Expand Up @@ -313,7 +313,7 @@ pub const Flags = packed struct {

pub const Visibility = enum {
global,
linkage,
hidden,
local,
};

Expand Down

0 comments on commit 2c97ad8

Please sign in to comment.