aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1991-12-01 02:58:37 +0000
committerSteve Chamberlain <sac@cygnus>1991-12-01 02:58:37 +0000
commit4aa58a0a29bc0efd20a79f4fc3babc183393f7fa (patch)
treeae9ab8ba90d66f27ab3e30ac5b7eb94bf24b3155 /binutils/nm.c
parentd289576d7fdbd3948a2308ef395a66690151d8b0 (diff)
downloadfsf-binutils-gdb-4aa58a0a29bc0efd20a79f4fc3babc183393f7fa.zip
fsf-binutils-gdb-4aa58a0a29bc0efd20a79f4fc3babc183393f7fa.tar.gz
fsf-binutils-gdb-4aa58a0a29bc0efd20a79f4fc3babc183393f7fa.tar.bz2
Updated to point to where the header files are now
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c60
1 files changed, 4 insertions, 56 deletions
diff --git a/binutils/nm.c b/binutils/nm.c
index 2fa1d7e..f0636c3 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -20,7 +20,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "bfd.h"
#include "sysdep.h"
#include "getopt.h"
-#include "stab.gnu.h"
+#include "aout/stab_gnu.h"
#include <ranlib.h>
@@ -329,50 +329,6 @@ filter_symbols (abfd, syms, symcount)
return dst_count;
}
-
-/* Return a lower-case character corresponding to the symbol class of sym */
-char
-decode_symclass (sym)
- asymbol *sym;
-{
- flagword flags = sym->flags;
-
- if ((sym->value == 0) && (sym->section != NULL))
- /* Huh? All section names don't begin with "." */
- return (sym->section->name)[1];
-
- if (flags & BSF_FORT_COMM) return 'C';
- if (flags & BSF_UNDEFINED) return 'U';
- if (flags & BSF_ABSOLUTE) return 'a';
-
-
- if ( (flags & BSF_GLOBAL) || (flags & BSF_LOCAL) ){
- if (sym->section == (asection *)NULL) {
- return '*';
- }
- else if ( !strcmp(sym->section->name, ".text") ){
- return 't';
- } else if ( !strcmp(sym->section->name, ".data") ){
- return 'd';
- } else if ( !strcmp(sym->section->name, ".bss") ){
- return 'b';
- } else {
- return 'o';
- }
- }
-
- /* We don't have to handle these cases just yet, but we will soon:
- N_SETV: 'v';
- N_SETA: 'l';
- N_SETT: 'x';
- N_SETD: 'z';
- N_SETB: 's';
- N_INDR: 'i';
- */
-
- return '?';
-}
-
static void
print_symbols (abfd, syms, symcount)
bfd *abfd;
@@ -392,17 +348,9 @@ print_symbols (abfd, syms, symcount)
else {
asymbol *p = *sym;
if (p) {
- class = decode_symclass (p);
-
- if (p->flags & BSF_GLOBAL)
- class = toupper (class);
-
- if (p->value || ((p->flags & BSF_UNDEFINED) != BSF_UNDEFINED))
- printf_vma( (p->section ? p->value + p->section->vma : p->value));
- else fputs (" ", stdout);
-
- printf (" %c %s\n", class, p->name ? p->name : "");
- }
+ bfd_print_symbol(abfd, stdout, p, bfd_print_symbol_nm);
+ putchar('\n');
+ }
}
}
}