public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] [ARC] Fix setting private flags when parsing .cpu.
@ 2016-04-12 12:59 Claudiu Zissulescu
  2016-04-13 13:39 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: Claudiu Zissulescu @ 2016-04-12 12:59 UTC (permalink / raw)
  To: binutils; +Cc: Claudiu.Zissulescu

The .cpu pseudo-op sets the current ARC architecture which we assemble for. However, we do not properly set the private flags, hence, this patch.

OK to apply?
Claudiu

gas/
2016-04-12  Claudiu Zissulescu  <claziss@synopsys.com>

	* config/tc-arc.c (mach_type_specified_p): Change type to
	bfd_boolean.
	(arc_option): Set private flags when parsing cpu pseudo-op.
	(md_parse_option): Set mach_type_specified_p to TRUE.
---
 gas/config/tc-arc.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gas/config/tc-arc.c b/gas/config/tc-arc.c
index 7486924..17e0b9a 100644
--- a/gas/config/tc-arc.c
+++ b/gas/config/tc-arc.c
@@ -396,8 +396,8 @@ static unsigned arc_features;
 /* The default architecture.  */
 static int arc_mach_type;
 
-/* Non-zero if the cpu type has been explicitly specified.  */
-static int mach_type_specified_p = 0;
+/* TRUE if the cpu type has been explicitly specified.  */
+static bfd_boolean mach_type_specified_p = FALSE;
 
 /* The hash table of instruction opcodes.  */
 static struct hash_control *arc_opcode_hash;
@@ -902,6 +902,9 @@ arc_option (int ignore ATTRIBUTE_UNUSED)
 
       if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach))
 	as_fatal (_("could not set architecture and machine"));
+
+      /* Set elf header flags.  */
+      bfd_set_private_flags (stdoutput, arc_eflag);
     }
   else
     if (arc_mach_type != mach)
@@ -3156,7 +3159,7 @@ md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
     case OPTION_MCPU:
       {
         arc_select_cpu (arg);
-        mach_type_specified_p = 1;
+        mach_type_specified_p = TRUE;
 	break;
       }
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-13 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-12 12:59 [PATCH] [ARC] Fix setting private flags when parsing .cpu Claudiu Zissulescu
2016-04-13 13:39 ` Nick Clifton
2016-04-13 14:50   ` Claudiu Zissulescu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).