From 377be14b1a78b7f0fc91fdede93c04b6aa4f9ca9 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 8 Feb 2024 10:16:03 +0100 Subject: elf2flt: update to 2024.02 --- toolchain/elf2flt/Makefile.inc | 4 +- .../0001-elf2flt-add-RISC-V-32-bit-support.patch | 66 ---------------------- toolchain/elf2flt/patches/v2023.09/0002-sh2.patch | 43 -------------- .../elf2flt/patches/v2023.09/0003-h8300.patch | 20 ------- toolchain/elf2flt/patches/v2024.02/0001-sh2.patch | 43 ++++++++++++++ .../elf2flt/patches/v2024.02/0002-h8300.patch | 20 +++++++ 6 files changed, 65 insertions(+), 131 deletions(-) delete mode 100644 toolchain/elf2flt/patches/v2023.09/0001-elf2flt-add-RISC-V-32-bit-support.patch delete mode 100644 toolchain/elf2flt/patches/v2023.09/0002-sh2.patch delete mode 100644 toolchain/elf2flt/patches/v2023.09/0003-h8300.patch create mode 100644 toolchain/elf2flt/patches/v2024.02/0001-sh2.patch create mode 100644 toolchain/elf2flt/patches/v2024.02/0002-h8300.patch (limited to 'toolchain') diff --git a/toolchain/elf2flt/Makefile.inc b/toolchain/elf2flt/Makefile.inc index ff7ab660e..a5eed1570 100644 --- a/toolchain/elf2flt/Makefile.inc +++ b/toolchain/elf2flt/Makefile.inc @@ -2,8 +2,8 @@ # material, please see the LICENCE file in the top-level directory. PKG_NAME:= elf2flt -ifeq ($(ADK_TOOLCHAIN_ELF2FLT_2023_09),y) -PKG_VERSION:= v2023.09 +ifeq ($(ADK_TOOLCHAIN_ELF2FLT_2024_02),y) +PKG_VERSION:= v2024.02 PKG_GIT:= tag PKG_RELEASE:= 1 PKG_SITES:= https://github.com/uclinux-dev/elf2flt.git diff --git a/toolchain/elf2flt/patches/v2023.09/0001-elf2flt-add-RISC-V-32-bit-support.patch b/toolchain/elf2flt/patches/v2023.09/0001-elf2flt-add-RISC-V-32-bit-support.patch deleted file mode 100644 index ed6fcaaee..000000000 --- a/toolchain/elf2flt/patches/v2023.09/0001-elf2flt-add-RISC-V-32-bit-support.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 44e34cb50f2d25848a85a59adbc561eee66278e8 Mon Sep 17 00:00:00 2001 -From: Yimin Gu -Date: Wed, 14 Dec 2022 06:49:46 -0500 -Subject: [PATCH] elf2flt: add RISC-V 32-bit support - -Allow elf2flt to work with 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. - -Signed-off-by: Charles Lohr -[Rebased onto latest tree for upstreaming] -Signed-off-by: Jesse Taube -[Add more ELF relco types and edit commit message] -Signed-off-by: Yimin Gu ---- - elf2flt.c | 6 ++++-- - ld-elf2flt.c | 2 +- - 2 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/elf2flt.c b/elf2flt.c -index f37cfa2..04b6b43 100644 ---- a/elf2flt.c -+++ b/elf2flt.c -@@ -81,7 +81,7 @@ const char *elf2flt_progname; - #include - #elif defined(TARGET_xtensa) - #include --#elif defined(TARGET_riscv64) -+#elif defined(TARGET_riscv64) || defined(TARGET_riscv32) - #include - #endif - -@@ -127,6 +127,8 @@ const char *elf2flt_progname; - #define ARCH "xtensa" - #elif defined(TARGET_riscv64) - #define ARCH "riscv64" -+#elif defined(TARGET_riscv32) -+#define ARCH "riscv32" - #else - #error "Don't know how to support your CPU architecture??" - #endif -@@ -822,7 +824,7 @@ output_relocs ( - goto good_32bit_resolved_reloc_update_text; - default: - goto bad_resolved_reloc; --#elif defined(TARGET_riscv64) -+#elif defined(TARGET_riscv64) || defined(TARGET_riscv32) - case R_RISCV_NONE: - case R_RISCV_32_PCREL: - case R_RISCV_ADD8: -diff --git a/ld-elf2flt.c b/ld-elf2flt.c -index 75ee1bb..68b2a4a 100644 ---- a/ld-elf2flt.c -+++ b/ld-elf2flt.c -@@ -327,7 +327,7 @@ static int do_final_link(void) - /* riscv adds a global pointer symbol to the linker file with the - "RISCV_GP:" prefix. Remove the prefix for riscv64 architecture and - the entire line for other architectures. */ -- if (streq(TARGET_CPU, "riscv64")) -+ if (streq(TARGET_CPU, "riscv64") || streq(TARGET_CPU, "riscv32")) - append_sed(&sed, "^RISCV_GP:", ""); - else - append_sed(&sed, "^RISCV_GP:", NULL); --- -2.30.2 - diff --git a/toolchain/elf2flt/patches/v2023.09/0002-sh2.patch b/toolchain/elf2flt/patches/v2023.09/0002-sh2.patch deleted file mode 100644 index b14a78e23..000000000 --- a/toolchain/elf2flt/patches/v2023.09/0002-sh2.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff -Nur elf2flt-v2023.09.orig/elf2flt.c elf2flt-v2023.09/elf2flt.c ---- elf2flt-v2023.09.orig/elf2flt.c 2023-12-22 10:44:11.000000000 +0100 -+++ elf2flt-v2023.09/elf2flt.c 2023-12-23 02:26:06.323239781 +0100 -@@ -73,7 +73,7 @@ - #define FLAT_NIOS2_R_HIADJ_LO 2 - #define FLAT_NIOS2_R_CALL26 4 - #include --#elif defined(TARGET_sh) -+#elif defined(TARGET_sh2) || defined(TARGET_sh2eb) - #include - #elif defined(TARGET_sparc) - #include -@@ -109,8 +109,10 @@ - #define ARCH "sparc" - #elif defined(TARGET_v850) - #define ARCH "v850" --#elif defined(TARGET_sh) --#define ARCH "sh" -+#elif defined(TARGET_sh2) -+#define ARCH "sh2" -+#elif defined(TARGET_sh2eb) -+#define ARCH "sh2" - #elif defined(TARGET_h8300) - #define ARCH "h8300" - #elif defined(TARGET_microblaze) -@@ -1289,7 +1291,7 @@ - #endif /* TARGET_sparc */ - - --#ifdef TARGET_sh -+#if defined(TARGET_sh2) || defined(TARGET_sh2eb) - case R_SH_DIR32: - relocation_needed = 1; - sym_vma = elf2flt_bfd_section_vma(sym_section); -@@ -1300,7 +1302,7 @@ - sym_addr += sym_vma + q->addend; - sym_addr -= q->address; - break; --#endif /* TARGET_sh */ -+#endif /* TARGET_sh2 / TARGET_sh2eb */ - - #ifdef TARGET_e1 - #define htoe1l(x) htonl(x) diff --git a/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch b/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch deleted file mode 100644 index 2c7b73482..000000000 --- a/toolchain/elf2flt/patches/v2023.09/0003-h8300.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -Nur elf2flt-v2023.09.orig/flthdr.c elf2flt-v2023.09/flthdr.c ---- elf2flt-v2023.09.orig/flthdr.c 2023-12-23 03:20:20.000000000 +0100 -+++ elf2flt-v2023.09/flthdr.c 2023-12-23 17:11:22.699413170 +0100 -@@ -164,8 +164,16 @@ - r = ntohl(relocs[i]); - raddr = flat_get_relocate_addr(r); - printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr); -+#if defined(TARGET_h8300) -+ raddr &= ~0x00000001; -+#endif - fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET); - fread_stream(&addr, sizeof(addr), 1, &ifp); -+#if defined(TARGET_h8300) -+ addr = ntohl(addr); -+ if (r & 1) -+ addr &= 0x00ffffff; -+#endif - printf("%"PRIx32"\n", addr); - } - diff --git a/toolchain/elf2flt/patches/v2024.02/0001-sh2.patch b/toolchain/elf2flt/patches/v2024.02/0001-sh2.patch new file mode 100644 index 000000000..b14a78e23 --- /dev/null +++ b/toolchain/elf2flt/patches/v2024.02/0001-sh2.patch @@ -0,0 +1,43 @@ +diff -Nur elf2flt-v2023.09.orig/elf2flt.c elf2flt-v2023.09/elf2flt.c +--- elf2flt-v2023.09.orig/elf2flt.c 2023-12-22 10:44:11.000000000 +0100 ++++ elf2flt-v2023.09/elf2flt.c 2023-12-23 02:26:06.323239781 +0100 +@@ -73,7 +73,7 @@ + #define FLAT_NIOS2_R_HIADJ_LO 2 + #define FLAT_NIOS2_R_CALL26 4 + #include +-#elif defined(TARGET_sh) ++#elif defined(TARGET_sh2) || defined(TARGET_sh2eb) + #include + #elif defined(TARGET_sparc) + #include +@@ -109,8 +109,10 @@ + #define ARCH "sparc" + #elif defined(TARGET_v850) + #define ARCH "v850" +-#elif defined(TARGET_sh) +-#define ARCH "sh" ++#elif defined(TARGET_sh2) ++#define ARCH "sh2" ++#elif defined(TARGET_sh2eb) ++#define ARCH "sh2" + #elif defined(TARGET_h8300) + #define ARCH "h8300" + #elif defined(TARGET_microblaze) +@@ -1289,7 +1291,7 @@ + #endif /* TARGET_sparc */ + + +-#ifdef TARGET_sh ++#if defined(TARGET_sh2) || defined(TARGET_sh2eb) + case R_SH_DIR32: + relocation_needed = 1; + sym_vma = elf2flt_bfd_section_vma(sym_section); +@@ -1300,7 +1302,7 @@ + sym_addr += sym_vma + q->addend; + sym_addr -= q->address; + break; +-#endif /* TARGET_sh */ ++#endif /* TARGET_sh2 / TARGET_sh2eb */ + + #ifdef TARGET_e1 + #define htoe1l(x) htonl(x) diff --git a/toolchain/elf2flt/patches/v2024.02/0002-h8300.patch b/toolchain/elf2flt/patches/v2024.02/0002-h8300.patch new file mode 100644 index 000000000..2c7b73482 --- /dev/null +++ b/toolchain/elf2flt/patches/v2024.02/0002-h8300.patch @@ -0,0 +1,20 @@ +diff -Nur elf2flt-v2023.09.orig/flthdr.c elf2flt-v2023.09/flthdr.c +--- elf2flt-v2023.09.orig/flthdr.c 2023-12-23 03:20:20.000000000 +0100 ++++ elf2flt-v2023.09/flthdr.c 2023-12-23 17:11:22.699413170 +0100 +@@ -164,8 +164,16 @@ + r = ntohl(relocs[i]); + raddr = flat_get_relocate_addr(r); + printf(" %u\t0x%08lx (0x%08"PRIx32")\t", i, r, raddr); ++#if defined(TARGET_h8300) ++ raddr &= ~0x00000001; ++#endif + fseek_stream(&ifp, sizeof(old_hdr) + raddr, SEEK_SET); + fread_stream(&addr, sizeof(addr), 1, &ifp); ++#if defined(TARGET_h8300) ++ addr = ntohl(addr); ++ if (r & 1) ++ addr &= 0x00ffffff; ++#endif + printf("%"PRIx32"\n", addr); + } + -- cgit v1.2.3