2002-02-04 Elena Zannoni <ezannoni@redhat.com>
[deliverable/binutils-gdb.git] / bfd / mmo.c
index 8bb509518f3f3e6df3fb48ca1ebdc1ab0676eb8b..ae7c42c4b4544c5451854c854c57b50a57cdac1f 100644 (file)
--- a/bfd/mmo.c
+++ b/bfd/mmo.c
@@ -1,5 +1,5 @@
 /* BFD back-end for mmo objects (MMIX-specific object-format).
-   Copyright 2001
+   Copyright 2001, 2002
    Free Software Foundation, Inc.
    Written by Hans-Peter Nilsson (hp@bitrange.com).
    Infrastructure and other bits originally copied from srec.c and
@@ -27,15 +27,15 @@ SECTION
 
        The mmo object format is used exclusively together with Professor
        Donald E.@: Knuth's educational 64-bit processor MMIX.  The simulator
-       @emph{mmix} which is available at
-       @emph{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
+       @command{mmix} which is available at
+       @url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}
        understands this format.  That package also includes a combined
-       assembler and linker called @emph{mmixal}.  The mmo format has
+       assembler and linker called @command{mmixal}.  The mmo format has
        no advantages feature-wise compared to e.g. ELF.  It is a simple
        non-relocatable object format with no support for archives or
        debugging information, except for symbol value information and
        line numbers (which is not yet implemented in BFD).  See
-       @emph{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
+       @url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more
        information about MMIX.  The ELF format is used for intermediate
        object files in the BFD implementation.
 
@@ -68,7 +68,7 @@ SUBSECTION
        two remaining bytes, called the @samp{Y} and @samp{Z} fields, or
        the @samp{YZ} field (a 16-bit big-endian number), are used for
        various purposes different for each lopcode.  As documented in
-       @emph{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
+       @url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz},
        the lopcodes are:
 
        There is provision for specifying ``special data'' of 65536
@@ -201,7 +201,6 @@ EXAMPLE
 #include "libiberty.h"
 #include "elf/mmix.h"
 #include "opcode/mmix.h"
-#include <ctype.h>
 
 #define LOP 0x98
 #define LOP_QUOTE 0
@@ -381,7 +380,6 @@ static boolean mmo_get_section_contents
   PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type));
 static long mmo_get_symtab_upper_bound PARAMS ((bfd *));
 static long mmo_get_symtab PARAMS ((bfd *, asymbol **));
-static asymbol *mmo_make_empty_symbol PARAMS ((bfd *));
 static void mmo_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *));
 static void mmo_print_symbol PARAMS ((bfd *, PTR, asymbol *,
                                      bfd_print_symbol_type));
@@ -482,10 +480,9 @@ mmo_init ()
   static const char letters[]
     = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789:_";
 
-  if (inited == false)
-    {
-      inited = true;
-    }
+  if (inited == true)
+    return;
+  inited = true;
 
   /* Fill in the set of valid symbol characters.  */
   strcpy (valid_mmo_symbol_character_set, letters);
@@ -1210,7 +1207,7 @@ SUBSECTION
        Symbol table format
 
        From mmixal.w (or really, the generated mmixal.tex) in
-       @emph{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
+       @url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}):
        ``Symbols are stored and retrieved by means of a @samp{ternary
        search trie}, following ideas of Bentley and Sedgewick. (See
        ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369;
@@ -2188,19 +2185,6 @@ mmo_get_symtab (abfd, alocation)
   return symcount;
 }
 
-/* Make an empty symbol.  */
-
-static asymbol *
-mmo_make_empty_symbol (abfd)
-     bfd *abfd;
-{
-  asymbol *new = (asymbol *) bfd_zalloc (abfd, sizeof (asymbol));
-
-  if (new)
-    new->the_bfd = abfd;
-  return new;
-}
-
 /* Get information about a symbol.  */
 
 static void
@@ -3171,6 +3155,7 @@ mmo_canonicalize_reloc (abfd, section, relptr, symbols)
 /* FIXME: We can do better on this one, if we have a dwarf2 .debug_line
    section or if MMO line numbers are implemented.  */
 #define mmo_find_nearest_line _bfd_nosymbols_find_nearest_line
+#define mmo_make_empty_symbol _bfd_generic_make_empty_symbol
 #define mmo_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define mmo_read_minisymbols _bfd_generic_read_minisymbols
 #define mmo_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol
This page took 0.025345 seconds and 4 git commands to generate.