From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0A7F321295B20 for ; Tue, 12 Jun 2018 08:23:27 -0700 (PDT) Received: by mail-wm0-x242.google.com with SMTP id j15-v6so24217472wme.0 for ; Tue, 12 Jun 2018 08:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LfLa8F4gsA3noW+oCZVDVbZS3fyISFGwd6SyXz5CxJs=; b=Q6hdJHytDWnObdJpmnSIZdrFav0LlvegpdXuHGearOrqjKXOWRq5OPh1pu4uhoKzzf OF7QBMqzxQTV6GY6ctZR5eU1NS97qxUXqqAnjEM8UMVqlvDNAlGZJcoRK45y6OpPremK yphnCw1cTRQphSUudnaKTMu2TIsVVnoeKGgmU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LfLa8F4gsA3noW+oCZVDVbZS3fyISFGwd6SyXz5CxJs=; b=crmOa6qNz19ma5wuB5PYvLe0mzzRcuaG33HbBVfzuAVtVB1olm2ip7yyzOQYDU/JBz 6mVIxDAuHAzo0YtQ8gN+LnqwLNKSJ/touCK3KVxwVWRql34StBXYVfNvdbnPwBOf5Gjc JNlvS6+JWlN15YrMti4yXDXJeAwgXe2gzsXhFoZ/lTC6Q6lqqWGY4bvONF8mHTsd5RsG 5lB/I9VzI/1cr83dtx2+MWrdr9UEiGSc+cXMN1UjQ6uvnD1mSdO1fFAecCm//zBfe5PO XmtIScx7Ixn4M+euFpBJ78ysEn0In6BPGE9t1ZNhZiTtMoa/eFgEkVm6qwgUZxQ/XcBA 7WXw== X-Gm-Message-State: APt69E2uu1BgnqXPTdsBoL8iMhz6mFCemIpX0PghkbKTcDo7sCLZKgyI ad1Of35VOfkhMtqQL2pmqTx3RtPqrvI= X-Google-Smtp-Source: ADUXVKK30PPgc/AUztUI/vT/7jXeRfUf2/s0NVSYwgg/yrZdshk4Jo0H1afWtX7SuD3QQLTiaR2TYw== X-Received: by 2002:a1c:f45:: with SMTP id 66-v6mr565986wmp.124.1528817006369; Tue, 12 Jun 2018 08:23:26 -0700 (PDT) Received: from dogfood.home ([2a01:cb1d:112:6f00:3c84:18ae:27f2:d03]) by smtp.gmail.com with ESMTPSA id e2-v6sm500983wro.97.2018.06.12.08.23.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 08:23:25 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Michael D Kinney , Liming Gao , Ruiyu Ni , Hao Wu , Leif Lindholm , Jordan Justen , Andrew Fish , Star Zeng , Eric Dong , Laszlo Ersek , Zenith432 , "Shi, Steven" Date: Tue, 12 Jun 2018 17:22:56 +0200 Message-Id: <20180612152306.25998-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180612152306.25998-1-ard.biesheuvel@linaro.org> References: <20180612152306.25998-1-ard.biesheuvel@linaro.org> Subject: [RFC PATCH 01/11] MdePkg/ProcessorBind.h: define macro to decorate module entry points X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2018 15:23:28 -0000 Add a macro EFI_ENTRYPOINT that we will use to decorate functions that serve as the entry points for EFI modules. This is necessary to work around a limitation in GCC, which may prune such routines from the ELF binary if they are defined with hidden visibility, even if they are explicitly referenced as the entry point on the linker command line. The hidden visibility is required to inform the compiler that, even though we are building the code in PIE mode, we are only doing so to get code that can run anywhere in the address space without requiring 64-bit wide absolute symbol references, and we are not interested in other things that PIE code typically provides, such as symbol preemptability and a reduced CoW footprint due to the fact that all dynamic relocations target the same area in the binary. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdePkg/Include/Base.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h index 4f7bd4449c36..eee48dcd4b29 100644 --- a/MdePkg/Include/Base.h +++ b/MdePkg/Include/Base.h @@ -274,6 +274,13 @@ VERIFY_SIZE_OF (__VERIFY_UINT32_ENUM_SIZE, 4); #define PACKED #endif +#ifndef EFI_ENTRYPOINT + // + // Set to empty value if not already set by the arch-specific header + // + #define EFI_ENTRYPOINT +#endif + /// /// 128 bit buffer containing a unique identifier value. /// Unless otherwise specified, aligned on a 64 bit boundary. -- 2.17.1