This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix sparc bitness overrides in GAS. Noticed by Eric Botcazou.
- From: David Miller <davem at davemloft dot net>
- To: binutils at sourceware dot org
- Cc: ebotcazou at adacore dot com
- Date: Tue, 20 Nov 2012 03:39:53 -0500 (EST)
- Subject: [PATCH] Fix sparc bitness overrides in GAS. Noticed by Eric Botcazou.
Only the older sets of arch specifications should override
the bitness of the object file we are creating. The newer
ones are supposed to leave the bitness alone.
Commited to mainline.
gas/
* config/tc-sparc.c (md_parse_option): Only certain arch
specifications should override the object to be 32-bit
or 64-bit.
---
gas/ChangeLog | 6 ++++++
gas/config/tc-sparc.c | 14 +++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f1e6207..bce371f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-20 David S. Miller <davem@davemloft.net>
+
+ * config/tc-sparc.c (md_parse_option): Only certain arch
+ specifications should override the object to be 32-bit
+ or 64-bit.
+
2012-11-14 David Holsgrove <david.holsgrove@xilinx.com>
* config/tc-microblaze.c (md_assemble): Add support for INST_TYPE_IMM5
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index fe7f8b0..d35b188 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -480,10 +480,18 @@ md_parse_option (int c, char *arg)
case OPTION_XARCH:
#ifdef OBJ_ELF
- if (strncmp (arg, "v9", 2) != 0)
- md_parse_option (OPTION_32, NULL);
- else
+ if (!strncmp (arg, "v9", 2))
md_parse_option (OPTION_64, NULL);
+ else
+ {
+ if (!strncmp (arg, "v8", 2)
+ || !strncmp (arg, "v7", 2)
+ || !strncmp (arg, "v6", 2)
+ || !strcmp (arg, "sparclet")
+ || !strcmp (arg, "sparclite")
+ || !strcmp (arg, "sparc86x"))
+ md_parse_option (OPTION_32, NULL);
+ }
#endif
/* Fall through. */
--
1.7.12.2.dirty