Fix linker error if FDT is not 16-byte aligned

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-10-23 10:21:31 +03:00
parent 3fcad0f599
commit 760f856d6f
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 1b6984db98e8d2b8ee223131080251cfc05be556 Mon Sep 17 00:00:00 2001
From: David Abdurachmanov <david.abdurachmanov@sifive.com>
Date: Wed, 23 Oct 2019 10:12:54 +0300
Subject: [PATCH] fw_payload.S: allow FDT payload where size is not 16-byte
aligned
Resolves the follow compilation error (payload variant for SiFive FU540 with
U-Boot and embedded FDT):
/usr/bin/ld: /build/platform/sifive/fu540/firmware/fw_payload.o(.text+0x1961): 15 bytes required for alignment to 16-byte boundary, but only 14 present
/usr/bin/ld: can't relax section: bad value
collect2: error: ld returned 1 exit status
Noticed while compiling 5.4-rc3+ kernel in Fedora/RISCV.
For more details see:
https://github.com/riscv/riscv-gnu-toolchain/issues/298
Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
---
firmware/fw_payload.S | 1 +
1 file changed, 1 insertion(+)
diff --git a/firmware/fw_payload.S b/firmware/fw_payload.S
index 4b4527a..702e150 100644
--- a/firmware/fw_payload.S
+++ b/firmware/fw_payload.S
@@ -85,6 +85,7 @@ fw_options:
add a0, zero, zero
ret
+.option norelax
#ifdef FW_PAYLOAD_FDT_PATH
.align 4
.section .text, "ax", %progbits
--
2.21.0

View File

@ -5,7 +5,7 @@ Name: opensbi-unstable
# The last part is short hash
# Format: <TAG>.<NUMBER_OF_COMMITS_AFTER_TAG>.<YEAR>.<MONTH>.<DAY>.<SHORT_COMMIT>
Version: v0.5.0.2019.10.09.be92da2
Release: 3%{?dist}
Release: 4%{?dist}
Summary: RISC-V Open Source Supervisor Binary Interface
License: BSD
@ -16,6 +16,8 @@ URL: https://github.com/riscv/opensbi
%global full_commit be92da280d87c38a2e0adc5d3f43bab7b5468f09
Source0: https://github.com/riscv/opensbi/archive/%{full_commit}.tar.gz
Patch0: 0001-fw_payload.S-allow-FDT-payload-where-size-is-not-16-.patch
BuildRequires: systemd-udev
BuildRequires: grubby-deprecated
BuildRequires: gcc
@ -205,6 +207,9 @@ popd
/boot/opensbi/unstable/fw_payload-uboot-sifive-fu540.{bin,elf}
%changelog
* Wed Oct 23 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> v0.5.0.2019.10.09.be92da2-4
- Fix linker error if DTB size is not 16-byte aligned
* Tue Oct 22 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> v0.5.0.2019.10.09.be92da2-3
- Rebuild for new kernel