| author | |
| committer | |
| log | e4d1bd610534c9a6ed01a17481bc4b6dc5b7d8dc |
| tree | d37cfde392588392596d845b8b21c86b3ae3b805 |
| parent | fd0baa9834293be085fd15929437f83986fb2243 |
| signature | Commit is signed but in an unrecognized format. |
5 files changed, 27 insertions(+), 29 deletions(-)
src/codegen.zig+1-1| ... | ... | @@ -862,7 +862,7 @@ pub fn genNavRef( |
| 862 | 862 | if (is_threadlocal) zo.symbols.items[sym_index].flags.tlv = true; |
| 863 | 863 | return @fromBackingInt(@intCast(sym_index)); |
| 864 | 864 | } |
| 865 | } else if (lf.cast(.coff2)) |coff| { | |
| 865 | } else if (lf.cast(.coff)) |coff| { | |
| 866 | 866 | return @fromBackingInt(@intCast(@backingInt(try coff.navSymbol(zcu, nav_index)))); |
| 867 | 867 | } else { |
| 868 | 868 | std.debug.panic("TODO genNavRef for '{t}'", .{lf.tag}); |
src/codegen/x86_64/Emit.zig+8-8| ... | ... | @@ -142,7 +142,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 142 | 142 | else if (emit.bin_file.cast(.macho)) |macho_file| |
| 143 | 143 | @fromBackingInt(@intCast(macho_file.getZigObject().?.getOrCreateMetadataForLazySymbol(macho_file, emit.pt, lazy_sym) catch |err| |
| 144 | 144 | return emit.fail("{s} creating lazy symbol", .{@errorName(err)}))) |
| 145 | else if (emit.bin_file.cast(.coff2)) |coff| | |
| 145 | else if (emit.bin_file.cast(.coff)) |coff| | |
| 146 | 146 | @fromBackingInt(@intCast(@backingInt(try coff.lazySymbol(lazy_sym)))) |
| 147 | 147 | else |
| 148 | 148 | return emit.fail("lazy symbols unimplemented for {s}", .{@tagName(emit.bin_file.tag)}), |
| ... | ... | @@ -157,7 +157,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 157 | 157 | .type = .FUNC, |
| 158 | 158 | }) else if (emit.bin_file.cast(.macho)) |macho_file| |
| 159 | 159 | @fromBackingInt(@intCast(try macho_file.getGlobalSymbol(extern_func.toSlice(&emit.lower.mir).?, null))) |
| 160 | else if (emit.bin_file.cast(.coff2)) |coff| @fromBackingInt(@intCast(@backingInt(try coff.globalSymbol(.{ | |
| 160 | else if (emit.bin_file.cast(.coff)) |coff| @fromBackingInt(@intCast(@backingInt(try coff.globalSymbol(.{ | |
| 161 | 161 | .name = extern_func.toSlice(&emit.lower.mir).?, |
| 162 | 162 | })))) else return emit.fail("external symbol unimplemented for {s}", .{@tagName(emit.bin_file.tag)}), |
| 163 | 163 | .is_extern = true, |
| ... | ... | @@ -171,7 +171,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 171 | 171 | switch (lowered_inst.encoding.mnemonic) { |
| 172 | 172 | .call => { |
| 173 | 173 | reloc.target = .{ .branch = target }; |
| 174 | if (target.is_dll_import and emit.bin_file.cast(.coff2) != null) { | |
| 174 | if (target.is_dll_import and emit.bin_file.cast(.coff) != null) { | |
| 175 | 175 | try emit.encodeInst(try .new(.none, .call, &.{ |
| 176 | 176 | .{ .mem = .initRip(.ptr, 0) }, |
| 177 | 177 | }, emit.lower.target), reloc_info); |
| ... | ... | @@ -252,7 +252,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 252 | 252 | }, emit.lower.target), reloc_info), |
| 253 | 253 | else => unreachable, |
| 254 | 254 | } |
| 255 | } else if (emit.bin_file.cast(.coff2)) |_| { | |
| 255 | } else if (emit.bin_file.cast(.coff)) |_| { | |
| 256 | 256 | if (target.is_dll_import) switch (lowered_inst.encoding.mnemonic) { |
| 257 | 257 | .lea => try emit.encodeInst(try .new(.none, .mov, &.{ |
| 258 | 258 | lowered_inst.ops[0], |
| ... | ... | @@ -372,7 +372,7 @@ pub fn emitMir(emit: *Emit) Error!void { |
| 372 | 372 | }, emit.lower.target), &.{}); |
| 373 | 373 | }, |
| 374 | 374 | else => unreachable, |
| 375 | } else if (emit.bin_file.cast(.coff2)) |coff| { | |
| 375 | } else if (emit.bin_file.cast(.coff)) |coff| { | |
| 376 | 376 | switch (emit.lower.target.cpu.arch) { |
| 377 | 377 | else => unreachable, |
| 378 | 378 | .x86 => { |
| ... | ... | @@ -845,7 +845,7 @@ fn encodeInst(emit: *Emit, lowered_inst: Instruction, reloc_info: []const RelocI |
| 845 | 845 | if (target.is_extern and !target.force_pcrel_direct) break :rt .GOTPCREL; |
| 846 | 846 | break :rt .PC32; |
| 847 | 847 | } }, |
| 848 | ) else if (emit.bin_file.cast(.coff2)) |coff| try coff.addReloc( | |
| 848 | ) else if (emit.bin_file.cast(.coff)) |coff| try coff.addReloc( | |
| 849 | 849 | @fromBackingInt(@intCast(@backingInt(emit.atom_id))), |
| 850 | 850 | end_offset - 4, |
| 851 | 851 | @fromBackingInt(@intCast(@backingInt(target.symbol))), |
| ... | ... | @@ -883,7 +883,7 @@ fn encodeInst(emit: *Emit, lowered_inst: Instruction, reloc_info: []const RelocI |
| 883 | 883 | .symbolnum = @intCast(@backingInt(target.symbol)), |
| 884 | 884 | }, |
| 885 | 885 | }); |
| 886 | } else if (emit.bin_file.cast(.coff2)) |coff| try coff.addReloc( | |
| 886 | } else if (emit.bin_file.cast(.coff)) |coff| try coff.addReloc( | |
| 887 | 887 | @fromBackingInt(@intCast(@backingInt(emit.atom_id))), |
| 888 | 888 | end_offset - 4, |
| 889 | 889 | @fromBackingInt(@intCast(@backingInt(target.symbol))), |
| ... | ... | @@ -941,7 +941,7 @@ fn encodeInst(emit: *Emit, lowered_inst: Instruction, reloc_info: []const RelocI |
| 941 | 941 | .symbolnum = @intCast(@backingInt(target.symbol)), |
| 942 | 942 | }, |
| 943 | 943 | }); |
| 944 | } else if (emit.bin_file.cast(.coff2)) |coff| try coff.addReloc( | |
| 944 | } else if (emit.bin_file.cast(.coff)) |coff| try coff.addReloc( | |
| 945 | 945 | @fromBackingInt(@intCast(@backingInt(emit.atom_id))), |
| 946 | 946 | end_offset - 4, |
| 947 | 947 | @fromBackingInt(@intCast(@backingInt(target.symbol))), |
src/dev.zig+1-3| ... | ... | @@ -109,7 +109,6 @@ pub const Env = enum { |
| 109 | 109 | .spork8_backend, |
| 110 | 110 | .lld_linker, |
| 111 | 111 | .coff_linker, |
| 112 | .coff2_linker, | |
| 113 | 112 | .elf_linker, |
| 114 | 113 | .elf2_linker, |
| 115 | 114 | .macho_linker, |
| ... | ... | @@ -231,7 +230,7 @@ pub const Env = enum { |
| 231 | 230 | .incremental, |
| 232 | 231 | .legalize, |
| 233 | 232 | .x86_64_backend, |
| 234 | .coff2_linker, | |
| 233 | .coff_linker, | |
| 235 | 234 | => true, |
| 236 | 235 | else => Env.sema.supports(feature), |
| 237 | 236 | }, |
| ... | ... | @@ -321,7 +320,6 @@ pub const Feature = enum { |
| 321 | 320 | |
| 322 | 321 | lld_linker, |
| 323 | 322 | coff_linker, |
| 324 | coff2_linker, | |
| 325 | 323 | elf_linker, |
| 326 | 324 | elf2_linker, |
| 327 | 325 | macho_linker, |
src/link.zig+16-16| ... | ... | @@ -587,7 +587,7 @@ pub const File = struct { |
| 587 | 587 | pub fn startProgress(base: *File, prog_node: std.Progress.Node) void { |
| 588 | 588 | switch (base.tag) { |
| 589 | 589 | else => {}, |
| 590 | inline .elf2, .coff2 => |tag| { | |
| 590 | inline .elf2, .coff => |tag| { | |
| 591 | 591 | dev.check(tag.devFeature()); |
| 592 | 592 | return @as(*tag.Type(), @fieldParentPtr("base", base)).startProgress(prog_node); |
| 593 | 593 | }, |
| ... | ... | @@ -597,7 +597,7 @@ pub const File = struct { |
| 597 | 597 | pub fn endProgress(base: *File) void { |
| 598 | 598 | switch (base.tag) { |
| 599 | 599 | else => {}, |
| 600 | inline .elf2, .coff2 => |tag| { | |
| 600 | inline .elf2, .coff => |tag| { | |
| 601 | 601 | dev.check(tag.devFeature()); |
| 602 | 602 | return @as(*tag.Type(), @fieldParentPtr("base", base)).endProgress(); |
| 603 | 603 | }, |
| ... | ... | @@ -651,10 +651,10 @@ pub const File = struct { |
| 651 | 651 | } |
| 652 | 652 | base.file = try emit.root_dir.handle.openFile(io, emit.sub_path, .{ .mode = .read_write }); |
| 653 | 653 | }, |
| 654 | .elf2, .coff2 => if (base.file == null) { | |
| 654 | .elf2, .coff => if (base.file == null) { | |
| 655 | 655 | const mf = if (base.cast(.elf2)) |elf| |
| 656 | 656 | &elf.mf |
| 657 | else if (base.cast(.coff2)) |coff| | |
| 657 | else if (base.cast(.coff)) |coff| | |
| 658 | 658 | &coff.mf |
| 659 | 659 | else |
| 660 | 660 | unreachable; |
| ... | ... | @@ -740,10 +740,10 @@ pub const File = struct { |
| 740 | 740 | } |
| 741 | 741 | } |
| 742 | 742 | }, |
| 743 | .elf2, .coff2 => if (base.file) |f| { | |
| 743 | .elf2, .coff => if (base.file) |f| { | |
| 744 | 744 | const mf = if (base.cast(.elf2)) |elf| |
| 745 | 745 | &elf.mf |
| 746 | else if (base.cast(.coff2)) |coff| | |
| 746 | else if (base.cast(.coff)) |coff| | |
| 747 | 747 | &coff.mf |
| 748 | 748 | else |
| 749 | 749 | unreachable; |
| ... | ... | @@ -841,7 +841,7 @@ pub const File = struct { |
| 841 | 841 | switch (base.tag) { |
| 842 | 842 | .lld => unreachable, |
| 843 | 843 | else => {}, |
| 844 | inline .elf, .elf2, .c, .coff2 => |tag| { | |
| 844 | inline .elf, .elf2, .c, .coff => |tag| { | |
| 845 | 845 | dev.check(tag.devFeature()); |
| 846 | 846 | return @as(*tag.Type(), @fieldParentPtr("base", base)).updateContainerType(pt, ty, success); |
| 847 | 847 | }, |
| ... | ... | @@ -899,7 +899,7 @@ pub const File = struct { |
| 899 | 899 | .lld => unreachable, |
| 900 | 900 | .plan9 => unreachable, |
| 901 | 901 | .spirv => {}, |
| 902 | .coff2 => {}, | |
| 902 | .coff => {}, | |
| 903 | 903 | inline else => |tag| { |
| 904 | 904 | dev.check(tag.devFeature()); |
| 905 | 905 | return @as(*tag.Type(), @fieldParentPtr("base", base)).updateLineNumber(pt, ti_id, line); |
| ... | ... | @@ -951,7 +951,7 @@ pub const File = struct { |
| 951 | 951 | pub fn idle(base: *File, tid: Zcu.PerThread.Id) Error!bool { |
| 952 | 952 | switch (base.tag) { |
| 953 | 953 | else => return false, |
| 954 | inline .elf2, .coff2 => |tag| { | |
| 954 | inline .elf2, .coff => |tag| { | |
| 955 | 955 | dev.check(tag.devFeature()); |
| 956 | 956 | return @as(*tag.Type(), @fieldParentPtr("base", base)).idle(tid); |
| 957 | 957 | }, |
| ... | ... | @@ -961,7 +961,7 @@ pub const File = struct { |
| 961 | 961 | pub fn updateErrorData(base: *File, pt: Zcu.PerThread) Error!void { |
| 962 | 962 | switch (base.tag) { |
| 963 | 963 | else => {}, |
| 964 | inline .elf2, .coff2 => |tag| { | |
| 964 | inline .elf2, .coff => |tag| { | |
| 965 | 965 | dev.check(tag.devFeature()); |
| 966 | 966 | return @as(*tag.Type(), @fieldParentPtr("base", base)).updateErrorData(pt); |
| 967 | 967 | }, |
| ... | ... | @@ -1242,7 +1242,7 @@ pub const File = struct { |
| 1242 | 1242 | assert(!base.post_prelink); |
| 1243 | 1243 | |
| 1244 | 1244 | switch (base.tag) { |
| 1245 | inline .coff2, .elf, .elf2, .wasm, .spirv => |tag| { | |
| 1245 | inline .coff, .elf, .elf2, .wasm, .spirv => |tag| { | |
| 1246 | 1246 | dev.check(tag.devFeature()); |
| 1247 | 1247 | return @as(*tag.Type(), @fieldParentPtr("base", base)).loadInput(input); |
| 1248 | 1248 | }, |
| ... | ... | @@ -1261,7 +1261,7 @@ pub const File = struct { |
| 1261 | 1261 | } |
| 1262 | 1262 | |
| 1263 | 1263 | switch (base.tag) { |
| 1264 | inline .elf2, .coff2, .wasm, .c => |tag| { | |
| 1264 | inline .elf2, .coff, .wasm, .c => |tag| { | |
| 1265 | 1265 | dev.check(tag.devFeature()); |
| 1266 | 1266 | try @as(*tag.Type(), @fieldParentPtr("base", base)).prelink(base.comp.link_prog_node); |
| 1267 | 1267 | }, |
| ... | ... | @@ -1302,7 +1302,7 @@ pub const File = struct { |
| 1302 | 1302 | } |
| 1303 | 1303 | |
| 1304 | 1304 | pub const Tag = enum { |
| 1305 | coff2, | |
| 1305 | coff, | |
| 1306 | 1306 | elf, |
| 1307 | 1307 | elf2, |
| 1308 | 1308 | macho, |
| ... | ... | @@ -1315,7 +1315,7 @@ pub const File = struct { |
| 1315 | 1315 | |
| 1316 | 1316 | pub fn Type(comptime tag: Tag) type { |
| 1317 | 1317 | return switch (tag) { |
| 1318 | .coff2 => Coff2, | |
| 1318 | .coff => Coff, | |
| 1319 | 1319 | .elf => Elf, |
| 1320 | 1320 | .elf2 => Elf2, |
| 1321 | 1321 | .macho => MachO, |
| ... | ... | @@ -1330,7 +1330,7 @@ pub const File = struct { |
| 1330 | 1330 | |
| 1331 | 1331 | fn fromObjectFormat(ofmt: std.Target.ObjectFormat, use_new_linker: bool) Tag { |
| 1332 | 1332 | return switch (ofmt) { |
| 1333 | .coff => .coff2, | |
| 1333 | .coff => .coff, | |
| 1334 | 1334 | .elf => if (use_new_linker) .elf2 else .elf, |
| 1335 | 1335 | .macho => .macho, |
| 1336 | 1336 | .wasm => .wasm, |
| ... | ... | @@ -1420,7 +1420,7 @@ pub const File = struct { |
| 1420 | 1420 | |
| 1421 | 1421 | pub const Lld = @import("link/Lld.zig"); |
| 1422 | 1422 | pub const C = @import("link/C.zig"); |
| 1423 | pub const Coff2 = @import("link/Coff.zig"); | |
| 1423 | pub const Coff = @import("link/Coff.zig"); | |
| 1424 | 1424 | pub const Spork8 = @import("link/Spork8.zig"); |
| 1425 | 1425 | pub const Elf = @import("link/Elf.zig"); |
| 1426 | 1426 | pub const Elf2 = @import("link/Elf2.zig"); |
src/link/Coff.zig+1-1| ... | ... | @@ -1607,7 +1607,7 @@ fn create( |
| 1607 | 1607 | errdefer file.close(io); |
| 1608 | 1608 | coff.* = .{ |
| 1609 | 1609 | .base = .{ |
| 1610 | .tag = .coff2, | |
| 1610 | .tag = .coff, | |
| 1611 | 1611 | |
| 1612 | 1612 | .comp = comp, |
| 1613 | 1613 | .emit = path, |