From 57562c8d507667b6fefcb7fbc7a305fbd610b5dd Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 26 Dec 2023 21:39:39 -0700 Subject: compiler: push entry symbol name resolution into the linker This is necessary because on COFF, the entry symbol name is not known until the linker has looked at the set of global symbol names to determine which of the four possible main entry points is present. --- src/target.zig | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/target.zig') diff --git a/src/target.zig b/src/target.zig index d1a98601cf..262632b373 100644 --- a/src/target.zig +++ b/src/target.zig @@ -683,23 +683,3 @@ pub fn backendSupportsFeature( .safety_checked_instructions => use_llvm, }; } - -pub fn defaultEntrySymbolName( - target: std.Target, - /// May be `undefined` when `target` is not WASI. - wasi_exec_model: std.builtin.WasiExecModel, -) ?[]const u8 { - return switch (target.ofmt) { - .coff => "wWinMainCRTStartup", - .macho => "_main", - .elf, .plan9 => switch (target.cpu.arch) { - .mips, .mipsel, .mips64, .mips64el => "__start", - else => "_start", - }, - .wasm => switch (wasi_exec_model) { - .reactor => "_initialize", - .command => "_start", - }, - else => null, - }; -} -- cgit v1.2.3