From patchwork Wed Nov 6 09:43:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dario Binacchi X-Patchwork-Id: 3630 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 8AEF53F16E for ; Wed, 6 Nov 2024 10:44:10 +0100 (CET) Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-5cbb635c3f3sf703271a12.0 for ; Wed, 06 Nov 2024 01:44:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1730886250; cv=pass; d=google.com; s=arc-20240605; b=kA80yy8Upu/nCd7O/2Y7ngFyK1XUqs40ipZ1guenGZHNYXaETmkJcbE5neZ0A4mPOp GaW0E/y9HI+OEa2s6NiLzsiy43U+u5+HS/E/O5Q0FfwrEGoyES6ISPQXAtAHhN3xPPBx FbGXVkGyZbUGcrBGHXXKKOJSEixqCx1Lo+Fdi3cTjiBUcNE5xXD8xkQl0WshbL3yiysU mRtPvZ+WwOqAyqsaO6jJ4VhVUdydPUmq89qjCP/x2FAxiX4fP3VjRNeoqaHnoHP8agFf tG2KFs1h0cg8BrBKT87JrDExir3OdBQUPz3hcPrR2fIXI0W1gJ0T0qUpUW5AE6kZFHoQ ZpQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2wqVF8PWsPxeBjpR6ayFSa5Q9qHncFJ0Ujm9sanvi2U=; fh=eCveUUxcUjev7R0DBxLD8f88Wh7RhArN6tozn0yqPS8=; b=S+UlVIFSEntBgKsq3IHQJk1PzfyJJ/FSR40O3vmu/288EFWX/QXZq8w8CNnx136XdR rWJszZSM0g+YNef+zry3hW/M9x0DkpXnj6A0Z73pzam1jZ+jQuqLvVheCKd/NFu635b2 u2Z7/t5Lab9q3a5H/dy/04mWUpyRnVDsvOtA+ZLWzzClzhXJ7Cq/tz3pVuFXjqWc9ouA tXCFW5Vld89N7vJfxD0zEHPflwLV1dVAjAQ7U0a8zPXe2Ocs0T9ltHfyMmAqS+1Hr7mU mvi8zKrphVHtBjkcDESQB7y62moOsE355Jd4hwbfIht6FS6Uy2nYebFqtpfQNbtzmL+D k0cA==; darn=patchwork.amarulasolutions.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=clb4RBAk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1730886250; x=1731491050; darn=patchwork.amarulasolutions.com; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:mime-version:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=2wqVF8PWsPxeBjpR6ayFSa5Q9qHncFJ0Ujm9sanvi2U=; b=Y0bybpZoX9k/iq0Dp2hicYf/54a/348/y59Hmi2vAJpi4Fs16/fPoo2jfM6Jap98Kl qP86vbsacjCHCxQfN7akyndZHbKwjeN3I7v1oibU8VFMIo74zD6LqS4G/vS/LVZPVwoc GyMMmqM6DBUte7Kw7FFcyqodqxP422Tkv3uq0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730886250; x=1731491050; h=list-unsubscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=2wqVF8PWsPxeBjpR6ayFSa5Q9qHncFJ0Ujm9sanvi2U=; b=mX5Xxaxh04TUAkvrHNE3qwkdCm+DJ28ssL+HTtefkhFuJcyhdyaO07G3fOue9/gC4W Azj7F7yw3pB1JefcoAEDkDLMrPB8UD+UO3GSAZpRz4/IKsNOU/E0oVeHlPLNYzvPcPHw 0QL2R7fc+N8DmYV5SSQrogEfc7A9MUfdW+7sISgwyv0JeLc2DuXOESKIrYXUWoaXt7xE Z8R8qFeKhgoNXnp2QY/l54WKlanMk3795aKH9AkB98bBMtjQ5JOi8b7Dk8uwuVsNtG+D KfC8tSeClqU5Tr+H/RwkP91pLAP+fmXefkpps3ZE0hBjcbxBxyKCs74qMesdlQQgyHdq KaNA== X-Forwarded-Encrypted: i=2; AJvYcCXY6L0mnpVw/DSrZvH4aUVB9DV4G+Va5isvOgQZJwIG4ki01iH1JlfbOTEDKYtQ3EAsaYyXXkuq6JELIr4d@patchwork.amarulasolutions.com X-Gm-Message-State: AOJu0Yx12u3hzikbSWZYj/ROEXNcwZlVTeH+oAmL2wTGLNPgWR/286iJ rzh0YNtHqStYB2lxhG+7zkdHEExKF1Fj/GefqkJW+ehntEiiQh7ePl1YItqrCSswZA== X-Google-Smtp-Source: AGHT+IEhmodKiQk+l9+6/PiD1XfdGUdPDzLC3ylJflTSyjEqBKZ/bWjSWnYdkrxh0XqIJAs2zCPW8Q== X-Received: by 2002:a05:6402:2709:b0:5ce:c7b1:e052 with SMTP id 4fb4d7f45d1cf-5cef55266f9mr2006820a12.9.1730886249890; Wed, 06 Nov 2024 01:44:09 -0800 (PST) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a05:6402:c10:b0:5c9:5b3:ee81 with SMTP id 4fb4d7f45d1cf-5cedffd79ebls575985a12.2.-pod-prod-00-eu; Wed, 06 Nov 2024 01:44:08 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcfhW5ogRLn/wiu3IPlxCfkIO7usdGVNxe1RennIGkB2G8gVMldYSfCgTIb0wOElmKcCmdTFOitgZRjzOq@amarulasolutions.com X-Received: by 2002:a17:907:7211:b0:a9a:babb:b916 with SMTP id a640c23a62f3a-a9ec6630cd9mr205833566b.15.1730886247621; Wed, 06 Nov 2024 01:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730886247; cv=none; d=google.com; s=arc-20240605; b=c725SnvCzjP0t+JDOEKd6CAQb6aKQS7UyH9Otvi81TazLtbFTmXh5PZ70EIdr98iTB k4HHvO/H6VZR9x+7FU+7j9n2I9cw+M8ypyVoPjkuZa3SbdTJ2mTHpVt6JgCUeb8wyryv GqNS8Gh45pBlVDmCDUCbiE6z5aRAntrF9xekPTMu6wHdxjJAY/FqyxspPQWVRadWAe7e eILSPhLtnzs61JP2iodqmGYRg7A6UdiOPkq9mk1RwvyZXpzxzrq4PURDgVnkF9ovwUP+ bwM61AaTvKhtxUTrDSgc8KiAU7lmtDp6nOfQ/y3KhV8ib+uD6a/7KXA9vIy6jSvw9lxz Yg3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=/1Atcn8iuQaR9kDv8iTft5Ye/GlkkyCYD7QfnaONHp4=; fh=cGJW6f8bAxgq+8AI4lgx2D66Byw99gygK7Kx08/nx5Q=; b=aIuUapwtB8T6H1CAsRFFQFdVTvGBU1L9DMx6PANbTnjisAjtTUnuyFp4FuWe6JKaw1 48YH6Yn8bt1Kim9YrCSB1RvpYftWMzAg2kCAoYrvFWpB2+IP85nuGJu9S5bxnl9Xa6Ii bTTrKgcddz/SHagtf1UB3107ZMoktN2rl7dg1fzYJduk8zvHbBMSizzXfEOLd6q4vjrv 0lbtIjJ+/BPW9OCTJFVypiHWS2Iq7Vyq/S/JfAdbnOZKUUyoPT/8oyBX4qsWVzOvkWnT baoTUVtm1geyY0hDAdSe97u8lqGHbtWvCEfItMqMOxxRR0aWrJnXUfutWs9sovp+Fqdm EcLQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=clb4RBAk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Received: from mail-sor-f41.google.com (mail-sor-f41.google.com. [209.85.220.41]) by mx.google.com with SMTPS id a640c23a62f3a-a9ec8b8ba6asor44550866b.3.2024.11.06.01.44.07 for (Google Transport Security); Wed, 06 Nov 2024 01:44:07 -0800 (PST) Received-SPF: pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) client-ip=209.85.220.41; X-Forwarded-Encrypted: i=1; AJvYcCXbDRubnX2ib5cduFZFg/WIrtul0kTaW+ZWeUM+d2WJYH87Adl4FE7rs0JqKm78/vo0b1/zrWNQGIRpQeJm@amarulasolutions.com X-Received: by 2002:a17:907:60d3:b0:a9a:b818:521d with SMTP id a640c23a62f3a-a9ec6632f32mr141631766b.18.1730886247102; Wed, 06 Nov 2024 01:44:07 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6474:ebbf:afb5:f524:6416:8e3]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5cee6abfcbdsm2485618a12.37.2024.11.06.01.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Nov 2024 01:44:06 -0800 (PST) From: Dario Binacchi To: buildroot@buildroot.org Cc: Sergey Matyukevich , Bartosz Bilas , Marleen Vos , Dick Olsson , Thomas Petazzoni , linux-amarula@amarulasolutions.com, Arnout Vandecappelle , Dario Binacchi Subject: [PATCH v5 1/2] boot/arm-trusted-firmware: v2.11: fix building ST elf file Date: Wed, 6 Nov 2024 10:43:44 +0100 Message-ID: <20241106094346.3694622-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Original-Sender: dario.binacchi@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=clb4RBAk; spf=pass (google.com: domain of dario.binacchi@amarulasolutions.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=dario.binacchi@amarulasolutions.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amarulasolutions.com; dara=pass header.i=@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The commit backports a pending, but likely correct, patch that fixes the following build error: 'buildroot/output/host/bin/arm-buildroot-linux-gnueabihf-gcc' -o buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf -Wl,--hash-style=gnu -Wl,--as-needed -nostartfiles -Wl,-Map=buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.map -Wl,-dT buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1.ld buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/stm32mp1-stm32mp157c-dk2.o buildroot/output/host/lib/gcc/arm-buildroot-linux-gnueabihf/13.3.0/../../../../arm-buildroot-linux-gnueabihf/bin/ld: buildroot/output/build/arm-trusted-firmware-custom/build/stm32mp1/release/tf-a-stm32mp157c-dk2.elf: error: PHDR segment not covered by LOAD segment collect2: error: ld returned 1 exit status Signed-off-by: Dario Binacchi --- No changes since v4 Changes v3 -> v4: - Replace the fixing patch. The previous patch did not pass the tests because it caused regressions on platforms other than ST. The review process led to a new patch specifically for the ST platform. No changes since v2 Added in v2 ...pie-option-when-building-ST-elf-file.patch | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch diff --git a/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch b/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch new file mode 100644 index 000000000000..d2b82e0921f4 --- /dev/null +++ b/boot/arm-trusted-firmware/v2.11/0001-fix-st-set-no-pie-option-when-building-ST-elf-file.patch @@ -0,0 +1,37 @@ +From fbd050b61652db732f7a7a1ca36450b1bb339298 Mon Sep 17 00:00:00 2001 +From: Yann Gautier +Date: Tue, 29 Oct 2024 13:42:07 +0100 +Subject: [PATCH] fix(st): set no-pie option when building ST elf file + +This elf file is used to build a binary file that concatenates BL2 and +its device tree blob. It then does not need PIE option, and this avoids +the following compilation error with some compiler versions: + error: PHDR segment not covered by LOAD segment + +Change-Id: I7562e8c1890275fe0409f3a23cc66a8e14ea1ee0 +Signed-off-by: Yann Gautier +Signed-off-by: Dario Binacchi +Upstream: backport from https://review.trustedfirmware.org/c/TF-A/trusted-firmware-a/+/32960 +--- + plat/st/common/common_rules.mk | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/plat/st/common/common_rules.mk b/plat/st/common/common_rules.mk +index 212a67d5168c..b9fe3d4d676f 100644 +--- a/plat/st/common/common_rules.mk ++++ b/plat/st/common/common_rules.mk +@@ -58,9 +58,9 @@ $(eval $(call MAKE_LD,${STM32_TF_LINKERFILE},$(STM32_LD_FILE),bl2)) + tf-a-%.elf: $(PLAT)-%.o ${STM32_TF_LINKERFILE} + @echo " LDS $<" + ifeq ($($(ARCH)-ld-id),gnu-gcc) +- ${Q}$($(ARCH)-ld) -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $< ++ ${Q}$($(ARCH)-ld) -o $@ $(subst --,-Wl$(comma)--,${STM32_TF_ELF_LDFLAGS}) -nostartfiles -Wl,-no-pie -Wl,-Map=$(@:.elf=.map) -Wl,-dT ${STM32_TF_LINKERFILE} $< + else +- ${Q}$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $< ++ ${Q}$($(ARCH)-ld) -o $@ ${STM32_TF_ELF_LDFLAGS} -no-pie -Map=$(@:.elf=.map) --script ${STM32_TF_LINKERFILE} $< + endif + + tf-a-%.bin: tf-a-%.elf +-- +2.43.0 +