summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch108
1 files changed, 108 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch
new file mode 100644
index 00000000..24e0894d
--- /dev/null
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0021-Added-relocations-for-MB-X.patch
@@ -0,0 +1,108 @@
1From 39ba1e8a13828ac3c860a72b95c3abae024044b5 Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nmekala@xilix.com>
3Date: Tue, 11 Sep 2018 17:30:17 +0530
4Subject: [PATCH 21/53] Added relocations for MB-X
5
6Conflicts:
7 bfd/bfd-in2.h
8 gas/config/tc-microblaze.c
9
10Conflicts:
11 gas/config/tc-microblaze.c
12
13Signed-off-by: Aayush Misra <aayushm@amd.com>
14---
15 bfd/reloc.c | 26 ++++++++++++++------------
16 gas/config/tc-microblaze.c | 11 +++++++++++
17 2 files changed, 25 insertions(+), 12 deletions(-)
18
19diff --git a/bfd/reloc.c b/bfd/reloc.c
20index 3e8647f601e..c5c0ce5d060 100644
21--- a/bfd/reloc.c
22+++ b/bfd/reloc.c
23@@ -6661,12 +6661,6 @@ ENUMDOC
24 the form "Symbol Op Symbol".
25 ENUM
26 BFD_RELOC_MICROBLAZE_32_NONE
27-ENUMDOC
28- This is a 32 bit reloc that stores the 32 bit pc relative value in
29- two words (with an imm instruction). No relocation is done here -
30- only used for relaxing.
31-ENUM
32- BFD_RELOC_MICROBLAZE_32_NONE
33 ENUMDOC
34 This is a 32 bit reloc that stores the 32 bit pc relative
35 value in two words (with an imm instruction). No relocation is
36@@ -6685,12 +6679,6 @@ ENUMDOC
37 done here - only used for relaxing
38 ENUM
39 BFD_RELOC_MICROBLAZE_64_GOTPC
40-ENUMDOC
41- This is a 64 bit reloc that stores the 32 bit pc relative
42- value in two words (with an imml instruction). No relocation is
43- done here - only used for relaxing
44-ENUM
45- BFD_RELOC_MICROBLAZE_64_GPC
46 ENUMDOC
47 This is a 64 bit reloc that stores the 32 bit pc relative
48 value in two words (with an imm instruction). The relocation is
49@@ -7929,6 +7917,20 @@ ENUMX
50 ENUMDOC
51 Linux eBPF relocations.
52
53+ This is a 64 bit reloc that stores 64-bit thread pointer relative offset
54+ to two words (uses imml instruction).
55+ENUM
56+BFD_RELOC_MICROBLAZE_64,
57+ENUMDOC
58+ This is a 64 bit reloc that stores the 64 bit pc relative
59+ value in two words (with an imml instruction). No relocation is
60+ done here - only used for relaxing
61+ENUM
62+BFD_RELOC_MICROBLAZE_64_PCREL,
63+ENUMDOC
64+ This is a 32 bit reloc that stores the 32 bit pc relative
65+ value in two words (with an imml instruction). No relocation is
66+ done here - only used for relaxing
67 ENUM
68 BFD_RELOC_EPIPHANY_SIMM8
69 ENUMDOC
70diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
71index f13efcae979..9b8b129e309 100644
72--- a/gas/config/tc-microblaze.c
73+++ b/gas/config/tc-microblaze.c
74@@ -91,6 +91,8 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP";
75 #define TLSTPREL_OFFSET 16
76 #define TEXT_OFFSET 17
77 #define TEXT_PC_OFFSET 18
78+#define DEFINED_64_OFFSET 19
79+#define DEFINED_64_PC_OFFSET 20
80
81 /* Initialize the relax table. */
82 const relax_typeS md_relax_table[] =
83@@ -114,6 +116,8 @@ const relax_typeS md_relax_table[] =
84 { 0x7fffffff, 0x80000000, INST_WORD_SIZE*2, 0 }, /* 16: TLSTPREL_OFFSET. */
85 { 0x7fffffff, 0x80000000, INST_WORD_SIZE*2, 0 }, /* 17: TEXT_OFFSET. */
86 { 0x7fffffff, 0x80000000, INST_WORD_SIZE*2, 0 } /* 18: TEXT_PC_OFFSET. */
87+ { 0x7fffffffffffffff, 0x8000000000000000, INST_WORD_SIZE, 0 }, /* 19: DEFINED_64_OFFSET. */
88+ { 0x7fffffffffffffff, 0x8000000000000000, INST_WORD_SIZE*2, 0 } /* 20: DEFINED_64_PC_OFFSET. */
89 };
90
91 static htab_t opcode_hash_control; /* Opcode mnemonics. */
92@@ -2330,6 +2334,13 @@ md_estimate_size_before_relax (fragS * fragP,
93 /* Variable part does not change. */
94 fragP->fr_var = INST_WORD_SIZE*2;
95 }
96+ else if (streq (fragP->fr_opcode, str_microblaze_64))
97+ {
98+ /* Used as an absolute value. */
99+ fragP->fr_subtype = DEFINED_64_OFFSET;
100+ /* Variable part does not change. */
101+ fragP->fr_var = INST_WORD_SIZE;
102+ }
103 else if (streq (fragP->fr_opcode, str_microblaze_ro_anchor))
104 {
105 /* It is accessed using the small data read only anchor. */
106--
1072.34.1
108