Skip to content

Commit

Permalink
Document ARGV_INIT_ARRAY
Browse files Browse the repository at this point in the history
  • Loading branch information
leo60228 committed Nov 22, 2019
1 parent 1ff055d commit e282b22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/sys/unix/args.rs
Expand Up @@ -78,6 +78,8 @@ mod imp {
ARGV = argv;
}

/// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension.
/// This allows `std::env::args` to work even in a `cdylib`, as it does on macOS and Windows.
#[cfg(all(target_os = "linux", target_env = "gnu"))]
#[used]
#[link_section = ".init_array.00099"]
Expand Down

0 comments on commit e282b22

Please sign in to comment.