From 0af70bac0e53d6adedf588591bdd7977e7317c96 Mon Sep 17 00:00:00 2001 From: Robert Pengelly Date: Sat, 20 Jun 2026 19:19:29 +0100 Subject: [PATCH] Check for just mainCRTStartup when targeting AMD64 PE --- link.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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"); -- 2.34.1