Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply Yimin Gu's fixes to elf2flt to allow riscv 32 to use the same
relocation mechansims as riscv 64. Original copy was passed around the buildroot list, but, it would be helpful for this to be upstream. cnlohr <[email protected]> rebased it. You can see the original patch here: 5330503 Below is the contents of the original patch: From 599e31157815a6e82d920693fafea249ef95dfc7 Mon Sep 17 00:00:00 2001 From: Yimin Gu <[email protected]> Date: Thu, 17 Nov 2022 21:16:28 +0900 Subject: [PATCH] Added RISC-V 32-bit compilation support Let elf2flt compile for RISC-V 32-bit targets. With these changes, the uclibc toolchain and busybox can work fine for rv32 no MMU systems with no noticable problem. and From 3f1f323 Mon Sep 17 00:00:00 2001 From: Damien Le Moal <[email protected]> Date: Wed, 9 Sep 2020 17:31:33 +0900 Subject: [PATCH] elf2flt: add riscv 64-bits support Add support for riscv 64bits ISA by defining the relocation types R_RISCV_32_PCREL, R_RISCV_ADD32, R_RISCV_SUB32, R_RISCV_32 and R_RISCV_64. riscv64 support also needs the __global_pointer$ symbol to be defined right after the relocation tables in the data section. To define this symbol, the "RISCV_GP" line prefix is added. The "RISCV_GP" string is removed if the target CPU type is riscv64 and the definition line is dropped for other CPU types. With these changes, buildroot and busybox build and run on riscv NOMMU systems with Linux kernel including patch 6045ab5fea4c ("binfmt_flat: do not stop relocating GOT entries prematurely on riscv") fixing the binfmt_flat loader. Tested on QEMU and Canaan Kendryte K210 boards. This patch is based on earlier work by Christoph Hellwig <[email protected]>. Signed-off-by: Damien Le Moal <[email protected]>
- Loading branch information