aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorTom Read Cutting <moosichu@users.noreply.github.com>2022-04-04 13:33:24 +0100
committerGitHub <noreply@github.com>2022-04-04 15:33:24 +0300
commitcdcb34cdf42fa3eb7a399106ccd57efc87643032 (patch)
treedfe6f49534679b4eb5aaae77292345e03db11b0a /lib/std/debug.zig
parent6d04ab6d5be1eaa47a920aaa3989bd3515fec5d6 (diff)
downloadzig-cdcb34cdf42fa3eb7a399106ccd57efc87643032.tar.gz
zig-cdcb34cdf42fa3eb7a399106ccd57efc87643032.zip
Pull elf magic string out to re-used constant
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index d2173e114a..e00c0a21a2 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -842,7 +842,7 @@ pub fn readElfDebugInfo(allocator: mem.Allocator, elf_file: File) !ModuleDebugIn
nosuspend {
const mapped_mem = try mapWholeFile(elf_file);
const hdr = @ptrCast(*const elf.Ehdr, &mapped_mem[0]);
- if (!mem.eql(u8, hdr.e_ident[0..4], "\x7fELF")) return error.InvalidElfMagic;
+ if (!mem.eql(u8, hdr.e_ident[0..4], elf.MAGIC)) return error.InvalidElfMagic;
if (hdr.e_ident[elf.EI_VERSION] != 1) return error.InvalidElfVersion;
const endian: std.builtin.Endian = switch (hdr.e_ident[elf.EI_DATA]) {