diff options
| author | Tom Read Cutting <moosichu@users.noreply.github.com> | 2022-04-04 13:33:24 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-04 15:33:24 +0300 |
| commit | cdcb34cdf42fa3eb7a399106ccd57efc87643032 (patch) | |
| tree | dfe6f49534679b4eb5aaae77292345e03db11b0a /lib/std/debug.zig | |
| parent | 6d04ab6d5be1eaa47a920aaa3989bd3515fec5d6 (diff) | |
| download | zig-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.zig | 2 |
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]) { |
