summaryrefslogtreecommitdiffstats
path: root/meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch')
-rw-r--r--meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch b/meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch
new file mode 100644
index 00000000..205f04fe
--- /dev/null
+++ b/meta-microblaze/recipes-devtools/binutils/binutils/0029-gas-revert-moving-of-md_pseudo_table-from-const.patch
@@ -0,0 +1,83 @@
1From 24d43f5ce8746c653de7de3fad46915755ba789d Mon Sep 17 00:00:00 2001
2From: Mahesh Bodapati <mbodapat@xilinx.com>
3Date: Mon, 8 Nov 2021 21:57:13 +0530
4Subject: [PATCH 29/34] gas: revert moving of md_pseudo_table from const
5
6The base system expect md_pseudo_table to be constant, Changing the
7definition will break other architectures when compiled with a
8unified source code.
9
10Patch reverts the change away from const, and implements a newer
11dynamic handler that passes the correct argument value based on word
12size.
13
14Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
15---
16 gas/config/tc-microblaze.c | 16 +++++++++++++---
17 gas/tc.h | 2 +-
18 2 files changed, 14 insertions(+), 4 deletions(-)
19
20diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
21index 31677446114..6b398ab5605 100644
22--- a/gas/config/tc-microblaze.c
23+++ b/gas/config/tc-microblaze.c
24@@ -385,6 +385,17 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED)
25 demand_empty_rest_of_line ();
26 }
27
28+/* Handle the .gpword pseudo-op, Pass to s_rva */
29+
30+static void
31+microblaze_s_gpword (int ignore ATTRIBUTE_UNUSED)
32+{
33+ int size = 4;
34+ if (microblaze_arch_size == 64)
35+ size = 8;
36+ s_rva(size);
37+}
38+
39 /* This table describes all the machine specific pseudo-ops the assembler
40 has to support. The fields are:
41 Pseudo-op name without dot
42@@ -392,7 +403,7 @@ microblaze_s_weakext (int ignore ATTRIBUTE_UNUSED)
43 Integer arg to pass to the function. */
44 /* If the pseudo-op is not found in this table, it searches in the obj-elf.c,
45 and then in the read.c table. */
46-pseudo_typeS md_pseudo_table[] =
47+const pseudo_typeS md_pseudo_table[] =
48 {
49 {"lcomm", microblaze_s_lcomm, 1},
50 {"data", microblaze_s_data, 0},
51@@ -401,7 +412,7 @@ pseudo_typeS md_pseudo_table[] =
52 {"data32", cons, 4}, /* Same as word. */
53 {"ent", s_func, 0}, /* Treat ent as function entry point. */
54 {"end", microblaze_s_func, 1}, /* Treat end as function end point. */
55- {"gpword", s_rva, 4}, /* gpword label => store resolved label address in data section. */
56+ {"gpword", microblaze_s_gpword, 0}, /* gpword label => store resolved label address in data section. */
57 {"weakext", microblaze_s_weakext, 0},
58 {"rodata", microblaze_s_rdata, 0},
59 {"sdata2", microblaze_s_rdata, 1},
60@@ -3456,7 +3467,6 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
61 case OPTION_M64:
62 //if (arg != NULL && strcmp (arg, "64") == 0)
63 microblaze_arch_size = 64;
64- md_pseudo_table[7].poc_val = 8;
65 break;
66 default:
67 return 0;
68diff --git a/gas/tc.h b/gas/tc.h
69index bb9a935a353..4a740f9bdd9 100644
70--- a/gas/tc.h
71+++ b/gas/tc.h
72@@ -22,7 +22,7 @@
73 /* In theory (mine, at least!) the machine dependent part of the assembler
74 should only have to include one file. This one. -- JF */
75
76-extern pseudo_typeS md_pseudo_table[];
77+extern const pseudo_typeS md_pseudo_table[];
78
79 const char * md_atof (int, char *, int *);
80 int md_parse_option (int, const char *);
81--
822.37.1 (Apple Git-137.1)
83