This is the mail archive of the binutils@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]

[PATCH 11/13] make expr_symbol_where () return a const file name


From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

gas/ChangeLog:

2016-02-21  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* expr.c (expr_symbol_where): Change type of file argument to
	const char **.
	* expr.h (expr_symbol_where): Likewise.
	* config/tc-i370.c (md_apply_fix): adjust.
	* config/tc-mmix.c (mmix_md_end): Likewise.
	* config/tc-ppc.c (md_apply_fix): Likewise.
	* config/tc-s390.c (md_apply_fix): Likewise.
	* symbols.c (report_op_error): Likewise.
	(resolve_symbol_value): Likewise.
---
 gas/config/tc-i370.c | 2 +-
 gas/config/tc-mmix.c | 2 +-
 gas/config/tc-ppc.c  | 4 ++--
 gas/config/tc-s390.c | 2 +-
 gas/expr.c           | 2 +-
 gas/expr.h           | 2 +-
 gas/symbols.c        | 4 ++--
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/gas/config/tc-i370.c b/gas/config/tc-i370.c
index 8554c6d..4795560 100644
--- a/gas/config/tc-i370.c
+++ b/gas/config/tc-i370.c
@@ -2498,7 +2498,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
 	 any operands that need relocation.  Due to the 12-bit naturew of
 	 i370 addressing, this would be unusual.  */
         {
-          char *sfile;
+          const char *sfile;
           unsigned int sline;
 
           /* Use expr_symbol_where to see if this is an expression
diff --git a/gas/config/tc-mmix.c b/gas/config/tc-mmix.c
index dac38d0..b7bfe14 100644
--- a/gas/config/tc-mmix.c
+++ b/gas/config/tc-mmix.c
@@ -3553,7 +3553,7 @@ mmix_md_end (void)
       actual_seg = S_GET_SEGMENT (loc_assert->loc_sym);
       if (actual_seg != loc_assert->old_seg)
 	{
-	  char *fnam;
+	  const char *fnam;
 	  unsigned int line;
 	  int e_valid = expr_symbol_where (loc_assert->loc_sym, &fnam, &line);
 
diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c
index 69dc0e8..71b2dac 100644
--- a/gas/config/tc-ppc.c
+++ b/gas/config/tc-ppc.c
@@ -6841,7 +6841,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
       gas_assert (fixP->fx_addsy != NULL);
       if (fixP->fx_r_type == BFD_RELOC_NONE)
 	{
-	  char *sfile;
+	  const char *sfile;
 	  unsigned int sline;
 
 	  /* Use expr_symbol_where to see if this is an expression
@@ -7069,7 +7069,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
 	default:
 	  if (fixP->fx_addsy)
 	    {
-	      char *sfile;
+	      const char *sfile;
 	      unsigned int sline;
 
 	      /* Use expr_symbol_where to see if this is an
diff --git a/gas/config/tc-s390.c b/gas/config/tc-s390.c
index e1ea68e..fda96a2 100644
--- a/gas/config/tc-s390.c
+++ b/gas/config/tc-s390.c
@@ -2316,7 +2316,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 	}
       else
 	{
-	  char *sfile;
+	  const char *sfile;
 	  unsigned int sline;
 
 	  /* Use expr_symbol_where to see if this is an expression
diff --git a/gas/expr.c b/gas/expr.c
index 9256a3e..8b7ad45 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -122,7 +122,7 @@ make_expr_symbol (expressionS *expressionP)
    the symbol.  */
 
 int
-expr_symbol_where (symbolS *sym, char **pfile, unsigned int *pline)
+expr_symbol_where (symbolS *sym, const char **pfile, unsigned int *pline)
 {
   struct expr_symbol_line *l;
 
diff --git a/gas/expr.h b/gas/expr.h
index 8b3c4f2..a270359 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -180,7 +180,7 @@ extern void subtract_from_result (expressionS *, offsetT, int);
 extern segT expr (int, expressionS *, enum expr_mode);
 extern unsigned int get_single_number (void);
 extern symbolS *make_expr_symbol (expressionS * expressionP);
-extern int expr_symbol_where (symbolS *, char **, unsigned int *);
+extern int expr_symbol_where (symbolS *, const char **, unsigned int *);
 extern void current_location (expressionS *);
 
 extern symbolS *expr_build_uconstant (offsetT);
diff --git a/gas/symbols.c b/gas/symbols.c
index 4628301..e117049 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -972,7 +972,7 @@ use_complex_relocs_for (symbolS * symp)
 static void
 report_op_error (symbolS *symp, symbolS *left, operatorT op, symbolS *right)
 {
-  char *file;
+  const char *file;
   unsigned int line;
   segT seg_left = left ? S_GET_SEGMENT (left) : 0;
   segT seg_right = S_GET_SEGMENT (right);
@@ -1379,7 +1379,7 @@ resolve_symbol_value (symbolS *symp)
 		 already issued a warning about using a bad symbol.  */
 	      if (seg_right == absolute_section && finalize_syms)
 		{
-		  char *file;
+		  const char *file;
 		  unsigned int line;
 
 		  if (expr_symbol_where (symp, &file, &line))
-- 
2.7.0


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