commit 731c6d3fbbd935233513f4779e19b4ca18c2006e (tree)
parent 750998eef62a70dbea8c3ba1d44245f506370911
Author: kcbanner <kcbanner@gmail.com>
Date: Sat, 26 Aug 2023 17:55:12 -0400
linux: export elf_aux_maybe so that libraries can call getauxval
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/lib/std/os/linux.zig b/lib/std/os/linux.zig
@@ -153,6 +153,10 @@ pub usingnamespace @import("linux/io_uring.zig");
/// Set by startup code, used by `getauxval`.
pub var elf_aux_maybe: ?[*]std.elf.Auxv = null;
+pub extern var _elf_aux_maybe: ?[*]std.elf.Auxv;
+comptime {
+ @export(elf_aux_maybe, .{ .name = "_elf_aux_maybe", .linkage = .Weak });
+}
/// See `std.elf` for the constants.
pub fn getauxval(index: usize) usize {