From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by mx.groups.io with SMTP id smtpd.web11.18273.1655389259478920553 for ; Thu, 16 Jun 2022 07:20:59 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HQCqxps/; spf=pass (domain: gmail.com, ip: 209.85.166.179, mailfrom: ayushdevel1325@gmail.com) Received: by mail-il1-f179.google.com with SMTP id a15so1007238ilq.12 for ; Thu, 16 Jun 2022 07:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to:cc; bh=PrZmSeHw5bLa6AmWczRXvwLDHgLGEIGpSgwPEec0Lhc=; b=HQCqxps/ZYDHKsQY2p7zvcO9Y07RHZe8Gtu/TZpd6hA8kWw6TDyyEy8g0S+7B2LADU iG0L+0dbt/R6RH04SLacmN5dEDSFBlnJSA5vVYMEaixCEKF6iywLdHkSHngTC0dAcyig Or+4fxVzP2/4meMb9ntQAciwmGBBE1NJz8o5PpAdBYyFAJc5VecME7o9XeFfEgF++c7M TaCXgYD1LZrbcvw2+IpRP9vOD3YRH9JbgX0sW/qaKcDiJYXbrveQerd32CUtJS7pzBW0 /m10HO0Yhke6hdcV+OISbdtoeHe7KXhOwHlOoSMvcs6ZR/sfs4IL/TwwsEULf8GNI0TA KQ2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=PrZmSeHw5bLa6AmWczRXvwLDHgLGEIGpSgwPEec0Lhc=; b=kxy8Oc8QFkcPuhpZyuYIKuv54nFAVLzx3/T5RHvheqaRCJjNjgV3N2XBhG2oxsziAA VT1XmXv74EPMryxJIB/4eZRPdEgRJExCdeNW8Jl040y+s1AamaIwMMDr9QANeLsYG2ov y22Ixaf1s66ng5v7/ffs34gh9jiEh6vDryBU8UF3LRLlBO7mUxdflENzECj19R208ILd uiQWonVJ1gbl1mnMmk7KoIbJgPv21h1IyBB2XgPV4YivTjIazZ43ZmHXrXHqbtV+h0CW ILJ0735arxAZSpw3gB/47yqQKmXxvvMPhwGNwtHPDNTdMmp76qLNbgAsOYgEBWdAR7nT c66Q== X-Gm-Message-State: AJIora+SRO58hTc0iuGpqlk4IZxLiR4gjiWXUYh919JOrTlHfn06pZ2V i0H31FrgNG6JuAcubbHfzmdI92hJxBPsY2418vdkjUh4R05LQeuG X-Google-Smtp-Source: AGRyM1vcJRWr4Tq3gaNxDI9MA3JsUXODKupBiZ6so0Bttd0ffAoLTWbej9GWuAqshR8sjbVar6onn+cnn83sNMTd9c0= X-Received: by 2002:a05:6e02:12eb:b0:2d3:e228:43e3 with SMTP id l11-20020a056e0212eb00b002d3e22843e3mr2861085iln.205.1655389258789; Thu, 16 Jun 2022 07:20:58 -0700 (PDT) MIME-Version: 1.0 From: "Ayush Singh" Date: Thu, 16 Jun 2022 19:50:47 +0530 Message-ID: Subject: Does edk2 also link to crt0-efi like GNU-EFI To: edk2-devel-groups-io Cc: Michael Kubacki , michael.d.kinney@intel.com, Jiewen Yao , jabeena.b.gaibusab@intel.com Content-Type: text/plain; charset="UTF-8" Hello everyone, I wanted to ask if the edk2 build system also links to crt0-efi, like GNU-EFI? If yes, I would also like to see how that is actually implemented. If not, how does edk2 support custom entry functions? It is possible with llvm backend but I am not sure how it is done in GCC and am curious, Currently, rust does not support the custom implementation of `lang_start` (which is started by crt0 in most platforms), so I was trying to find ways to be able to use custom crt0 which sets up `SystemTable` and `SystemHandler` and start the `lang_start` from it. This way, the user will be able to call the normal `main` function rather than using the `no_main` feature. My blog post [1] shows how we currently use the `efi_main` function. Yours sincerely, Ayush Singh [1]: (https://www.programmershideaway.xyz/post5/)