summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2023-02-23 13:18:06 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-24 11:04:27 +0000
commitff3279d4412db0155bb5b9ba51f74ef496f4aaa6 (patch)
treecf7d3a390640a11d9ef5f0e0deb54faf55a40b4c /meta/recipes-bsp
parent1e783583bf8330f4bf348f38caedca7d6e1b361c (diff)
downloadpoky-ff3279d4412db0155bb5b9ba51f74ef496f4aaa6.tar.gz
grub: Handle R_RISCV_CALL_PLT reloc
These are new in binutils 2.40+ (From OE-Core rev: f2883fb1d7302087479940b422ba836d2fe35fc4) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp')
-rw-r--r--meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch48
-rw-r--r--meta/recipes-bsp/grub/grub2.inc1
2 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch b/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch
new file mode 100644
index 0000000000..f3f12b6f0e
--- /dev/null
+++ b/meta/recipes-bsp/grub/files/0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch
@@ -0,0 +1,48 @@
1From 64be669638e198bc0c7c1a344547265dfacd2470 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 23 Jan 2023 15:29:02 -0800
4Subject: [PATCH] risc-v: Handle R_RISCV_CALL_PLT reloc
5
6GNU assembler starting 2.40 release always generates R_RISCV_CALL_PLT
7reloc for call in assembler [1], similarly llvm does not make
8distinction between R_RISCV_CALL_PLT and R_RISCV_CALL [2]
9
10Upstream-Status: Submitted [https://lists.gnu.org/archive/html/grub-devel/2023-02/msg00143.html]
11
12[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=70f35d72ef04cd23771875c1661c9975044a749c
13[2] https://reviews.llvm.org/D132530
14
15Upstream-Status: Pending
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 grub-core/kern/riscv/dl.c | 1 +
19 1 file changed, 1 insertion(+)
20
21--- a/grub-core/kern/riscv/dl.c
22+++ b/grub-core/kern/riscv/dl.c
23@@ -188,6 +188,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t
24 break;
25
26 case R_RISCV_CALL:
27+ case R_RISCV_CALL_PLT:
28 {
29 grub_uint32_t *abs_place = place;
30 grub_ssize_t off = sym_addr - (grub_addr_t) place;
31--- a/util/grub-mkimagexx.c
32+++ b/util/grub-mkimagexx.c
33@@ -1294,6 +1294,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, st
34 }
35 break;
36 case R_RISCV_CALL:
37+ case R_RISCV_CALL_PLT:
38 {
39 grub_uint32_t hi20, lo12;
40
41@@ -1725,6 +1726,7 @@ translate_relocation_pe (struct translat
42 case R_RISCV_BRANCH:
43 case R_RISCV_JAL:
44 case R_RISCV_CALL:
45+ case R_RISCV_CALL_PLT:
46 case R_RISCV_PCREL_HI20:
47 case R_RISCV_PCREL_LO12_I:
48 case R_RISCV_PCREL_LO12_S:
diff --git a/meta/recipes-bsp/grub/grub2.inc b/meta/recipes-bsp/grub/grub2.inc
index bf7aba6b1c..b92cbc2654 100644
--- a/meta/recipes-bsp/grub/grub2.inc
+++ b/meta/recipes-bsp/grub/grub2.inc
@@ -40,6 +40,7 @@ SRC_URI = "${GNU_MIRROR}/grub/grub-${PV}.tar.gz \
40 file://0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \ 40 file://0001-font-Fix-size-overflow-in-grub_font_get_glyph_intern.patch \
41 file://CVE-2022-2601.patch \ 41 file://CVE-2022-2601.patch \
42 file://CVE-2022-3775.patch \ 42 file://CVE-2022-3775.patch \
43 file://0001-risc-v-Handle-R_RISCV_CALL_PLT-reloc.patch \
43" 44"
44 45
45SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f" 46SRC_URI[sha256sum] = "23b64b4c741569f9426ed2e3d0e6780796fca081bee4c99f62aa3f53ae803f5f"