aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-09-09 09:27:02 -0700
committerAndrew Kelley <andrew@ziglang.org>2022-09-09 09:27:02 -0700
commit68e61bbc0c3b896d5d549168ff8b88fe04e2269f (patch)
treeccd5e52fbb961fcbda0b602268ab9abfbe00b2c4 /lib/std
parentc7d6048081053c2852d4d3af5d549d83473f808c (diff)
downloadzig-68e61bbc0c3b896d5d549168ff8b88fe04e2269f.tar.gz
zig-68e61bbc0c3b896d5d549168ff8b88fe04e2269f.zip
std.zig.system.NativeTargetInfo: more headroom for libc.so.6 .dynstr
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/zig/system/NativeTargetInfo.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/zig/system/NativeTargetInfo.zig b/lib/std/zig/system/NativeTargetInfo.zig
index a4d29c17b4..73f76b11b7 100644
--- a/lib/std/zig/system/NativeTargetInfo.zig
+++ b/lib/std/zig/system/NativeTargetInfo.zig
@@ -552,14 +552,14 @@ fn glibcVerFromSoFile(file: fs.File) !std.builtin.Version {
// and furthermore, that the system-installed glibc is at minimum that version.
// Empirically, glibc 2.34 libc.so .dynstr section is 32441 bytes on my system.
- // Here I use this value plus some headroom. This makes it only need
+ // Here I use double this value plus some headroom. This makes it only need
// a single read syscall here.
- var buf: [40000]u8 = undefined;
+ var buf: [80000]u8 = undefined;
if (buf.len < dynstr.size) return error.InvalidGnuLibCVersion;
const dynstr_size = @intCast(usize, dynstr.size);
const dynstr_bytes = buf[0..dynstr_size];
- _ = try preadMin(file, dynstr_bytes, dynstr.offset, dynstr_size);
+ _ = try preadMin(file, dynstr_bytes, dynstr.offset, dynstr_bytes.len);
var it = mem.split(u8, dynstr_bytes, &.{0});
var max_ver: std.builtin.Version = .{ .major = 2, .minor = 2, .patch = 5 };
while (it.next()) |s| {