2007-11-09 H.J. Lu <hongjiu.lu@intel.com>
[deliverable/binutils-gdb.git] / gas / symbols.c
index 816395ff22d935a89acee937e863d10e826b2a7b..b631a1d6aa4eea8a0363209e583c51202ac397f0 100644 (file)
@@ -7,7 +7,7 @@
 
    GAS is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2, or (at your option)
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
    GAS is distributed in the hope that it will be useful,
@@ -2728,14 +2728,20 @@ print_symbol_value_1 (FILE *file, symbolS *sym)
   const char *name = S_GET_NAME (sym);
   if (!name || !name[0])
     name = "(unnamed)";
-  fprintf (file, "sym %lx %s", (unsigned long) sym, name);
+  fprintf (file, "sym ");
+  fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) sym));
+  fprintf (file, " %s", name);
 
   if (LOCAL_SYMBOL_CHECK (sym))
     {
       struct local_symbol *locsym = (struct local_symbol *) sym;
-      if (local_symbol_get_frag (locsym) != &zero_address_frag
+
+      if (local_symbol_get_frag (locsym) != & zero_address_frag
          && local_symbol_get_frag (locsym) != NULL)
-       fprintf (file, " frag %lx", (long) local_symbol_get_frag (locsym));
+       {
+         fprintf (file, " frag ");
+         fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) local_symbol_get_frag (locsym)));
+        }
       if (local_symbol_resolved_p (locsym))
        fprintf (file, " resolved");
       fprintf (file, " local");
@@ -2743,7 +2749,10 @@ print_symbol_value_1 (FILE *file, symbolS *sym)
   else
     {
       if (sym->sy_frag != &zero_address_frag)
-       fprintf (file, " frag %lx", (long) sym->sy_frag);
+       {
+         fprintf (file, " frag ");
+         fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) sym->sy_frag));
+       }
       if (sym->written)
        fprintf (file, " written");
       if (sym->sy_resolved)
@@ -2817,7 +2826,9 @@ print_binary (FILE *file, const char *name, expressionS *exp)
 void
 print_expr_1 (FILE *file, expressionS *exp)
 {
-  fprintf (file, "expr %lx ", (long) exp);
+  fprintf (file, "expr ");
+  fprintf_vma (file, (bfd_vma) ((bfd_hostptr_t) exp));
+  fprintf (file, " ");
   switch (exp->X_op)
     {
     case O_illegal:
@@ -3004,7 +3015,7 @@ symbol_relc_make_value (offsetT val)
   char * terminal = xmalloc (28);  /* Enough for long long.  */
 
   terminal[0] = '#';
-  sprintf_vma (& terminal[1], val);
+  bfd_sprintf_vma (stdoutput, terminal + 1, val);
   return terminal;
 }
 
This page took 0.02454 seconds and 4 git commands to generate.