This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] work around get_symbol_name () in sparc and ia64


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e87de5136e9054974b812a362099826fc83e74e9

commit e87de5136e9054974b812a362099826fc83e74e9
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Sun Feb 28 17:21:12 2016 -0500

    work around get_symbol_name () in sparc and ia64
    
    get_symbol_name () returns a char * in a out arg, which means we need to cast
    to assign a literal to the variable passed to get_symbol_name ().  It seems
    like better APIs than get_symbol_name () could be provided, but that seems like
    a fair amount of work so just casting seems to be the betterthing to do for
    now.
    
    gas/ChangeLog:
    
    2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
    
    	* config/tc-ia64.c (md_assemble): Add temporary variable to pass to
    	get_symbol_name ().
    	* config/tc-sparc.c (s_register): Cast a literal to char * in
    	assignment.

Diff:
---
 gas/ChangeLog         | 7 +++++++
 gas/config/tc-ia64.c  | 6 ++++--
 gas/config/tc-sparc.c | 2 +-
 3 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9b6d066..4b3127c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,12 @@
 2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+	* config/tc-ia64.c (md_assemble): Add temporary variable to pass to
+	get_symbol_name ().
+	* config/tc-sparc.c (s_register): Cast a literal to char * in
+	assignment.
+
+2016-03-31  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
+
 	* config/tc-i960.c (parse_expr): Cast to char * when assigning to
 	input_line_pointer.
 	* config/tc-m32r.c (expand_debug_syms): Likewise.
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 85f6095..a50b61e 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -10667,7 +10667,8 @@ check_dv (struct ia64_opcode *idesc)
 void
 md_assemble (char *str)
 {
-  char *saved_input_line_pointer, *mnemonic;
+  char *saved_input_line_pointer, *temp;
+  const char *mnemonic;
   const struct pseudo_opcode *pdesc;
   struct ia64_opcode *idesc;
   unsigned char qp_regno;
@@ -10679,7 +10680,8 @@ md_assemble (char *str)
 
   /* extract the opcode (mnemonic):  */
 
-  ch = get_symbol_name (&mnemonic);
+  ch = get_symbol_name (&temp);
+  mnemonic = temp;
   pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic);
   if (pdesc)
     {
diff --git a/gas/config/tc-sparc.c b/gas/config/tc-sparc.c
index 6f2de4d..9f30d3a 100644
--- a/gas/config/tc-sparc.c
+++ b/gas/config/tc-sparc.c
@@ -4413,7 +4413,7 @@ s_register (int ignore ATTRIBUTE_UNUSED)
       if (regname[0] == 'i')
 	regname = NULL;
       else
-	regname = "";
+	regname = (char *) "";
     }
   else
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]