blob: edeecfd2f8025cd3fd31321fdedb98e35412afa2 [file] [log] [blame]
Brad Bishop286d45c2018-10-02 15:21:57 -04001From 8b733a61ab54ba4cedb234020562502d20eebcbb Mon Sep 17 00:00:00 2001
2From: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
3Date: Mon, 28 Aug 2017 19:53:53 -0700
4Subject: [PATCH] MicroBlaze add mlittle-endian and mbig-endian flags
5
6Added support in gas for mlittle-endian and mbig-endian flags
7as options.
8
9Updated show usage for MicroBlaze specific assembler options
10to include new entries.
11
12Signed-off-by: Nagaraju Mekala <nagaraju.mekala@xilinx.com>
13Signed-off-by: David Holsgrove <david.holsgrove@xilinx.com>
14Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com>
15Upstream-Status: Pending
16
17---
18 gas/config/tc-microblaze.c | 9 +++++++++
19 1 file changed, 9 insertions(+)
20
21diff --git a/gas/config/tc-microblaze.c b/gas/config/tc-microblaze.c
22index 0194cd9..42dd7ae 100644
23--- a/gas/config/tc-microblaze.c
24+++ b/gas/config/tc-microblaze.c
25@@ -37,6 +37,8 @@
26
27 #define OPTION_EB (OPTION_MD_BASE + 0)
28 #define OPTION_EL (OPTION_MD_BASE + 1)
29+#define OPTION_LITTLE (OPTION_MD_BASE + 2)
30+#define OPTION_BIG (OPTION_MD_BASE + 3)
31
32 void microblaze_generate_symbol (char *sym);
33 static bfd_boolean check_spl_reg (unsigned *);
34@@ -1837,6 +1839,8 @@ struct option md_longopts[] =
35 {
36 {"EB", no_argument, NULL, OPTION_EB},
37 {"EL", no_argument, NULL, OPTION_EL},
38+ {"mlittle-endian", no_argument, NULL, OPTION_LITTLE},
39+ {"mbig-endian", no_argument, NULL, OPTION_BIG},
40 { NULL, no_argument, NULL, 0}
41 };
42
43@@ -2471,9 +2475,11 @@ md_parse_option (int c, const char * arg ATTRIBUTE_UNUSED)
44 switch (c)
45 {
46 case OPTION_EB:
47+ case OPTION_BIG:
48 target_big_endian = 1;
49 break;
50 case OPTION_EL:
51+ case OPTION_LITTLE:
52 target_big_endian = 0;
53 break;
54 default:
55@@ -2488,6 +2494,9 @@ md_show_usage (FILE * stream ATTRIBUTE_UNUSED)
56 /* fprintf(stream, _("\
57 MicroBlaze options:\n\
58 -noSmall Data in the comm and data sections do not go into the small data section\n")); */
59+ fprintf (stream, _(" MicroBlaze specific assembler options:\n"));
60+ fprintf (stream, " -%-23s%s\n", "mbig-endian", N_("assemble for a big endian cpu"));
61+ fprintf (stream, " -%-23s%s\n", "mlittle-endian", N_("assemble for a little endian cpu"));
62 }
63
64