| author | |
| committer | |
| log | fb6f5a30b2d6334d0f1415446849d39fe00d3af0 |
| tree | 3455ae3d513a4ed7ce7269a15fb1253d66d031d2 |
| parent | a69f55a7cc3980f4d4dfcce6cb9d21a597975c7f |
| signature |
8 files changed, 17 insertions(+), 17 deletions(-)
src/link/Elf.zig+5-5| ... | ... | @@ -1100,7 +1100,7 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod |
| 1100 | 1100 | error.MalformedObject, |
| 1101 | 1101 | error.MalformedArchive, |
| 1102 | 1102 | error.MismatchedEflags, |
| 1103 | error.InvalidCpuArch, | |
| 1103 | error.InvalidMachineType, | |
| 1104 | 1104 | => continue, // already reported |
| 1105 | 1105 | else => |e| try self.reportParseError( |
| 1106 | 1106 | obj.path, |
| ... | ... | @@ -1187,7 +1187,7 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod |
| 1187 | 1187 | |
| 1188 | 1188 | for (system_libs.items) |lib| { |
| 1189 | 1189 | self.parseLibrary(lib, false) catch |err| switch (err) { |
| 1190 | error.MalformedObject, error.MalformedArchive, error.InvalidCpuArch => continue, // already reported | |
| 1190 | error.MalformedObject, error.MalformedArchive, error.InvalidMachineType => continue, // already reported | |
| 1191 | 1191 | else => |e| try self.reportParseError( |
| 1192 | 1192 | lib.path, |
| 1193 | 1193 | "unexpected error: parsing library failed with error {s}", |
| ... | ... | @@ -1213,7 +1213,7 @@ pub fn flushModule(self: *Elf, arena: Allocator, tid: Zcu.PerThread.Id, prog_nod |
| 1213 | 1213 | error.MalformedObject, |
| 1214 | 1214 | error.MalformedArchive, |
| 1215 | 1215 | error.MismatchedEflags, |
| 1216 | error.InvalidCpuArch, | |
| 1216 | error.InvalidMachineType, | |
| 1217 | 1217 | => continue, // already reported |
| 1218 | 1218 | else => |e| try self.reportParseError( |
| 1219 | 1219 | obj.path, |
| ... | ... | @@ -1642,7 +1642,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { |
| 1642 | 1642 | pub const ParseError = error{ |
| 1643 | 1643 | MalformedObject, |
| 1644 | 1644 | MalformedArchive, |
| 1645 | InvalidCpuArch, | |
| 1645 | InvalidMachineType, | |
| 1646 | 1646 | MismatchedEflags, |
| 1647 | 1647 | OutOfMemory, |
| 1648 | 1648 | Overflow, |
| ... | ... | @@ -1813,7 +1813,7 @@ fn parseLdScript(self: *Elf, lib: SystemLib) ParseError!void { |
| 1813 | 1813 | .needed = scr_obj.needed, |
| 1814 | 1814 | .path = full_path, |
| 1815 | 1815 | }, false) catch |err| switch (err) { |
| 1816 | error.MalformedObject, error.MalformedArchive, error.InvalidCpuArch => continue, // already reported | |
| 1816 | error.MalformedObject, error.MalformedArchive, error.InvalidMachineType => continue, // already reported | |
| 1817 | 1817 | else => |e| try self.reportParseError( |
| 1818 | 1818 | full_path, |
| 1819 | 1819 | "unexpected error: parsing library failed with error {s}", |
src/link/Elf/Object.zig+1-1| ... | ... | @@ -112,7 +112,7 @@ fn parseCommon(self: *Object, allocator: Allocator, handle: std.fs.File, elf_fil |
| 112 | 112 | "invalid ELF machine type: {s}", |
| 113 | 113 | .{@tagName(self.header.?.e_machine)}, |
| 114 | 114 | ); |
| 115 | return error.InvalidCpuArch; | |
| 115 | return error.InvalidMachineType; | |
| 116 | 116 | } |
| 117 | 117 | try elf_file.validateEFlags(self.index, self.header.?.e_flags); |
| 118 | 118 |
src/link/Elf/SharedObject.zig+1-1| ... | ... | @@ -63,7 +63,7 @@ pub fn parse(self: *SharedObject, elf_file: *Elf, handle: std.fs.File) !void { |
| 63 | 63 | "invalid ELF machine type: {s}", |
| 64 | 64 | .{@tagName(self.header.?.e_machine)}, |
| 65 | 65 | ); |
| 66 | return error.InvalidCpuArch; | |
| 66 | return error.InvalidMachineType; | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | const shoff = std.math.cast(usize, self.header.?.e_shoff) orelse return error.Overflow; |
src/link/Elf/relocatable.zig+2-2| ... | ... | @@ -21,7 +21,7 @@ pub fn flushStaticLib(elf_file: *Elf, comp: *Compilation, module_obj_path: ?[]co |
| 21 | 21 | parsePositional(elf_file, obj.path) catch |err| switch (err) { |
| 22 | 22 | error.MalformedObject, |
| 23 | 23 | error.MalformedArchive, |
| 24 | error.InvalidCpuArch, | |
| 24 | error.InvalidMachineType, | |
| 25 | 25 | error.MismatchedEflags, |
| 26 | 26 | => continue, // already reported |
| 27 | 27 | error.UnknownFileType => try elf_file.reportParseError(obj.path, "unknown file type for an object file", .{}), |
| ... | ... | @@ -178,7 +178,7 @@ pub fn flushObject(elf_file: *Elf, comp: *Compilation, module_obj_path: ?[]const |
| 178 | 178 | elf_file.parsePositional(obj.path, obj.must_link) catch |err| switch (err) { |
| 179 | 179 | error.MalformedObject, |
| 180 | 180 | error.MalformedArchive, |
| 181 | error.InvalidCpuArch, | |
| 181 | error.InvalidMachineType, | |
| 182 | 182 | error.MismatchedEflags, |
| 183 | 183 | => continue, // already reported |
| 184 | 184 | else => |e| try elf_file.reportParseError( |
src/link/MachO.zig+1-1| ... | ... | @@ -921,7 +921,7 @@ fn parseInputFileWorker(self: *MachO, file: File) void { |
| 921 | 921 | error.MalformedObject, |
| 922 | 922 | error.MalformedDylib, |
| 923 | 923 | error.MalformedTbd, |
| 924 | error.InvalidCpuArch, | |
| 924 | error.InvalidMachineType, | |
| 925 | 925 | error.InvalidTarget, |
| 926 | 926 | => {}, // already reported |
| 927 | 927 | else => |e| self.reportParseError2(file.getIndex(), "unexpected error: parsing input file failed with error {s}", .{@errorName(e)}) catch {}, |
src/link/MachO/Dylib.zig+2-2| ... | ... | @@ -75,12 +75,12 @@ fn parseBinary(self: *Dylib, macho_file: *MachO) !void { |
| 75 | 75 | macho.CPU_TYPE_X86_64 => .x86_64, |
| 76 | 76 | else => |x| { |
| 77 | 77 | try macho_file.reportParseError2(self.index, "unknown cpu architecture: {d}", .{x}); |
| 78 | return error.InvalidCpuArch; | |
| 78 | return error.InvalidMachineType; | |
| 79 | 79 | }, |
| 80 | 80 | }; |
| 81 | 81 | if (macho_file.getTarget().cpu.arch != this_cpu_arch) { |
| 82 | 82 | try macho_file.reportParseError2(self.index, "invalid cpu architecture: {s}", .{@tagName(this_cpu_arch)}); |
| 83 | return error.InvalidCpuArch; | |
| 83 | return error.InvalidMachineType; | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | const lc_buffer = try gpa.alloc(u8, header.sizeofcmds); |
src/link/MachO/Object.zig+4-4| ... | ... | @@ -91,12 +91,12 @@ pub fn parse(self: *Object, macho_file: *MachO) !void { |
| 91 | 91 | macho.CPU_TYPE_X86_64 => .x86_64, |
| 92 | 92 | else => |x| { |
| 93 | 93 | try macho_file.reportParseError2(self.index, "unknown cpu architecture: {d}", .{x}); |
| 94 | return error.InvalidCpuArch; | |
| 94 | return error.InvalidMachineType; | |
| 95 | 95 | }, |
| 96 | 96 | }; |
| 97 | 97 | if (cpu_arch != this_cpu_arch) { |
| 98 | 98 | try macho_file.reportParseError2(self.index, "invalid cpu architecture: {s}", .{@tagName(this_cpu_arch)}); |
| 99 | return error.InvalidCpuArch; | |
| 99 | return error.InvalidMachineType; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | const lc_buffer = try gpa.alloc(u8, self.header.?.sizeofcmds); |
| ... | ... | @@ -1648,12 +1648,12 @@ pub fn parseAr(self: *Object, macho_file: *MachO) !void { |
| 1648 | 1648 | macho.CPU_TYPE_X86_64 => .x86_64, |
| 1649 | 1649 | else => |x| { |
| 1650 | 1650 | try macho_file.reportParseError2(self.index, "unknown cpu architecture: {d}", .{x}); |
| 1651 | return error.InvalidCpuArch; | |
| 1651 | return error.InvalidMachineType; | |
| 1652 | 1652 | }, |
| 1653 | 1653 | }; |
| 1654 | 1654 | if (macho_file.getTarget().cpu.arch != this_cpu_arch) { |
| 1655 | 1655 | try macho_file.reportParseError2(self.index, "invalid cpu architecture: {s}", .{@tagName(this_cpu_arch)}); |
| 1656 | return error.InvalidCpuArch; | |
| 1656 | return error.InvalidMachineType; | |
| 1657 | 1657 | } |
| 1658 | 1658 | |
| 1659 | 1659 | const lc_buffer = try gpa.alloc(u8, self.header.?.sizeofcmds); |
src/link/MachO/relocatable.zig+1-1| ... | ... | @@ -232,7 +232,7 @@ fn parseInputFilesAr(macho_file: *MachO) !void { |
| 232 | 232 | |
| 233 | 233 | for (macho_file.objects.items) |index| { |
| 234 | 234 | macho_file.getFile(index).?.parseAr(macho_file) catch |err| switch (err) { |
| 235 | error.InvalidCpuArch => {}, // already reported | |
| 235 | error.InvalidMachineType => {}, // already reported | |
| 236 | 236 | else => |e| try macho_file.reportParseError2(index, "unexpected error: parsing input file failed with error {s}", .{@errorName(e)}), |
| 237 | 237 | }; |
| 238 | 238 | } |