summaryrefslogtreecommitdiff
path: root/toolchain/elf2flt/patches/v2024.02/0001-sh2.patch
blob: b14a78e23fa6ebc7ed26ada1db2f9ebfe9cced0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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 <elf/nios2.h>
-#elif defined(TARGET_sh)
+#elif defined(TARGET_sh2) || defined(TARGET_sh2eb)
 #include <elf/sh.h>
 #elif defined(TARGET_sparc)
 #include <elf/sparc.h>
@@ -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)