authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-10-09 17:22:39+02:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-10-09 17:40:37+02:00
log8dc40236153e7c7d1b8378a117d8453e3b262933
treec80890e85d3753655630fc701792d8e481aa99a2
parentba41e599bfaff2c614c4edfbe5c7ffe94b437486
signaturelock-open Commit is signed but in an unrecognized format.

Apply nitpick: top-level doc comments

Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>

1 files changed, 30 insertions(+), 30 deletions(-)

src/link/MachO/Trie.zig+30-30
......@@ -1,33 +1,33 @@
1/// Represents export trie used in MachO executables and dynamic libraries.
2/// The purpose of an export trie is to encode as compactly as possible all
3/// export symbols for the loader `dyld`.
4/// The export trie encodes offset and other information using ULEB128
5/// encoding, and is part of the __LINKEDIT segment.
6///
7/// Description from loader.h:
8///
9/// The symbols exported by a dylib are encoded in a trie. This is a compact
10/// representation that factors out common prefixes. It also reduces LINKEDIT pages
11/// in RAM because it encodes all information (name, address, flags) in one small,
12/// contiguous range. The export area is a stream of nodes. The first node sequentially
13/// is the start node for the trie.
14///
15/// Nodes for a symbol start with a uleb128 that is the length of the exported symbol
16/// information for the string so far. If there is no exported symbol, the node starts
17/// with a zero byte. If there is exported info, it follows the length.
18///
19/// First is a uleb128 containing flags. Normally, it is followed by a uleb128 encoded
20/// offset which is location of the content named by the symbol from the mach_header
21/// for the image. If the flags is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags
22/// is a uleb128 encoded library ordinal, then a zero terminated UTF8 string. If the string
23/// is zero length, then the symbol is re-export from the specified dylib with the same name.
24/// If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following the flags is two
25/// uleb128s: the stub offset and the resolver offset. The stub is used by non-lazy pointers.
26/// The resolver is used by lazy pointers and must be called to get the actual address to use.
27///
28/// After the optional exported symbol information is a byte of how many edges (0-255) that
29/// this node has leaving it, followed by each edge. Each edge is a zero terminated UTF8 of
30/// the addition chars in the symbol, followed by a uleb128 offset for the node that edge points to.
1//! Represents export trie used in MachO executables and dynamic libraries.
2//! The purpose of an export trie is to encode as compactly as possible all
3//! export symbols for the loader `dyld`.
4//! The export trie encodes offset and other information using ULEB128
5//! encoding, and is part of the __LINKEDIT segment.
6//!
7//! Description from loader.h:
8//!
9//! The symbols exported by a dylib are encoded in a trie. This is a compact
10//! representation that factors out common prefixes. It also reduces LINKEDIT pages
11//! in RAM because it encodes all information (name, address, flags) in one small,
12//! contiguous range. The export area is a stream of nodes. The first node sequentially
13//! is the start node for the trie.
14//!
15//! Nodes for a symbol start with a uleb128 that is the length of the exported symbol
16//! information for the string so far. If there is no exported symbol, the node starts
17//! with a zero byte. If there is exported info, it follows the length.
18//!
19//! First is a uleb128 containing flags. Normally, it is followed by a uleb128 encoded
20//! offset which is location of the content named by the symbol from the mach_header
21//! for the image. If the flags is EXPORT_SYMBOL_FLAGS_REEXPORT, then following the flags
22//! is a uleb128 encoded library ordinal, then a zero terminated UTF8 string. If the string
23//! is zero length, then the symbol is re-export from the specified dylib with the same name.
24//! If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following the flags is two
25//! uleb128s: the stub offset and the resolver offset. The stub is used by non-lazy pointers.
26//! The resolver is used by lazy pointers and must be called to get the actual address to use.
27//!
28//! After the optional exported symbol information is a byte of how many edges (0-255) that
29//! this node has leaving it, followed by each edge. Each edge is a zero terminated UTF8 of
30//! the addition chars in the symbol, followed by a uleb128 offset for the node that edge points to.
3131const Trie = @This();
3232
3333const std = @import("std");