From: Robert Pengelly Date: Sat, 20 Jun 2026 18:19:29 +0000 (+0100) Subject: Check for just mainCRTStartup when targeting AMD64 PE X-Git-Url: https://git.candlhat.org/?a=commitdiff_plain;h=0af70bac0e53d6adedf588591bdd7977e7317c96;p=slink.git Check for just mainCRTStartup when targeting AMD64 PE --- diff --git a/link.c b/link.c index 31eab40..e6ae991 100644 --- a/link.c +++ b/link.c @@ -970,7 +970,18 @@ static void calculate_entry_point (void) { } - } else if (state->format == LD_FORMAT_I386_PE || state->format == LD_FORMAT_AMD64_PE) { + } else if (state->format == LD_FORMAT_AMD64_PE) { + + state->entry_symbol_name = xstrdup ("mainCRTStartup"); + + if ((symbol = symbol_find (state->entry_symbol_name))) { + + state->entry_point = symbol_get_value_no_base (symbol); + return; + + } + + } else if (state->format == LD_FORMAT_I386_PE) { state->entry_symbol_name = xstrdup ("_mainCRTStartup");