From patchwork Thu Feb 12 00:13:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1830 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770855288; bh=XUH72L7yc4l4LOCEbnBmOj2cm9HdvBmbPjhoF18Idd8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=EZ9RhjAjw7c0UYQ25FLfil8TMzOwIAEwjQwyNxFusKtwAhSaEH5Es/txQ9ISrVEcH X0qmpb2QvmzJYJZocgSwRwazBE5tD94iCHBtPSNe8PbstyDkwi21B7zs57IR/9aazP nbFTj8lXoBlteA1xQoH7qGptvc7+xXS1gcdy0XkVbPv7wYlheeJpXMOW+02ZaeRems V4YZ31HJMPSdNg7H718U0zXWX9SA9MGYDHAPDPnsn5tDcxsllBwEsU2D14rfin4drw 80GL0itP2yaai6gCvRxyJS6G6eSUxwxavohegYTv3aa7KTG466nivjInHpjfMKv3bx ldc2OU2FH5tPA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CAFCE69A99 for ; Wed, 11 Feb 2026 17:14:48 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id I5LQp051fY67 for ; Wed, 11 Feb 2026 17:14:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770855288; bh=XUH72L7yc4l4LOCEbnBmOj2cm9HdvBmbPjhoF18Idd8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=EZ9RhjAjw7c0UYQ25FLfil8TMzOwIAEwjQwyNxFusKtwAhSaEH5Es/txQ9ISrVEcH X0qmpb2QvmzJYJZocgSwRwazBE5tD94iCHBtPSNe8PbstyDkwi21B7zs57IR/9aazP nbFTj8lXoBlteA1xQoH7qGptvc7+xXS1gcdy0XkVbPv7wYlheeJpXMOW+02ZaeRems V4YZ31HJMPSdNg7H718U0zXWX9SA9MGYDHAPDPnsn5tDcxsllBwEsU2D14rfin4drw 80GL0itP2yaai6gCvRxyJS6G6eSUxwxavohegYTv3aa7KTG466nivjInHpjfMKv3bx ldc2OU2FH5tPA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BB10169A90 for ; Wed, 11 Feb 2026 17:14:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770855287; bh=KZY7bEKTFf7SOEgogDXb2ffMaJ0IyY23KXdEb41t8IQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQqmxKprZTZ92mlGn+04QQTdpaGzjfqWyU45xQkBFfHYJqaqB9YVT+vcL6qPDq02l BYZubdnO6qjyM9LFj8lzgLyBJNaOT1wqXpUzdcF4tWtjT4UfTZC/cIkMR/WX41bTYF 9gKf9lRwZviQmAhlYBx1rH+v5BEQZQIn98WbCQYR+8gv6YAyuT6HMW32ALhjS3JKSi qatm+YID+Y2COaM33usvUsUi9VwL93DG4Z3KwrtG3pWd5cq1IRX3BReYc36u2e2P3G 4pIB0GEMrYm8tHENtzqCvGbE1EWh0qsaxtuQkWcVcLDX7hL+OelA97L81UqCAFPcMs rTVxXlwLpvPuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6BED569A90; Wed, 11 Feb 2026 17:14:47 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id vwL2SNM1zafb; Wed, 11 Feb 2026 17:14:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770855282; bh=MLIDfFqGjAa1s9wUEQuisKv/iLmuKI3TQX6AXPWzuMA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a9Qm9PPk/v4mjcnqTc+4awd22m6Q5bGOHSte5Ij2wfcrbJEIaz2d8p6I7dSb6AQJT d3GDGZO2Ps4FTAD2sOtf46mToSqWzjuNujzCW2VJfPfQGscjuUYEc+McJJ4NyCra9g NvWbJpCAUjOa0+lFLKAM590+19u5EKu1AP89RHf0p8SjehVxZfjDBi0O48f60+zWVn nKCMHb04KeYYApzePYNCt8NaJ1PBrPp0fS1mH3ULgsle0I/pGgcOYwWSE+qNFQkV6L UKaZgAKIoaWc8o8EqSCkgcgikIHUK3/44/h1GvfF5FV2XwX95pgVZsF0fHSDfGzwja 4/m1wjH27mAeg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DDB7C69AAD; Wed, 11 Feb 2026 17:14:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Wed, 11 Feb 2026 17:13:58 -0700 Message-ID: <20260212001410.1919749-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260212001410.1919749-1-sjg@u-boot.org> References: <20260212001410.1919749-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IG7UA7ZUTZJK3SDBV7R4VBCH27237YFX X-Message-ID-Hash: IG7UA7ZUTZJK3SDBV7R4VBCH27237YFX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 6" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/15] riscv: Add EFI application build flags List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add the build machinery for RISC-V EFI applications in config.mk: - OBJCOPYFLAGS_EFI for the EFI stub binary sections - LDFLAGS_FINAL with -shared -Bsymbolic for the shared-object link - LDSCRIPT pointing to the EFI app linker script - Separate OBJCOPYFLAGS_EFI for the app, which uses a different set of sections since the linker script groups data contiguously Co-developed-by: Claude Opus 4.6 Signed-off-by: Simon Glass --- arch/riscv/config.mk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/riscv/config.mk b/arch/riscv/config.mk index 123b5d24cca..1d98c015357 100644 --- a/arch/riscv/config.mk +++ b/arch/riscv/config.mk @@ -33,3 +33,20 @@ endif EFI_CRT0 := crt0_riscv_efi.o EFI_RELOC := reloc_riscv_efi.o + +OBJCOPYFLAGS_EFI += -j .text -j .rodata -j .data -j .sdata -j .dynamic \ + -j .dynsym -j .rela -j .reloc -j .got -j .got.plt \ + -j __u_boot_list -j .embedded_dtb -O binary + +ifeq ($(CONFIG_EFI_APP),y) + +LDFLAGS_FINAL += -znocombreloc -shared -Bsymbolic --gc-sections +LDSCRIPT := $(srctree)/arch/riscv/lib/elf_riscv64_efi_app.lds + +# The EFI app linker script places all data sections contiguously +# between _data and _edata so the PE .data section covers them. +OBJCOPYFLAGS_EFI := -j .text -j .rela.dyn \ + -j .dynsym -j .dynstr -j .embedded_dtb -j .data \ + -O binary + +endif