Add a flag to asection, linker_has_input, and use it to reliably
[deliverable/binutils-gdb.git] / bfd / versados.c
index 27f4f882088a4cc982dbe46da8cf9cc16045bf8d..e281d71b18efd142c51e5436025416716914abb5 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for VERSAdos-E objects.
-   Copyright 1995, 96, 97, 98, 1999 Free Software Foundation, Inc.
+   Copyright 1995, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support <sac@cygnus.com>.
 
    Versados is a Motorola trademark.
@@ -36,7 +36,6 @@
    o Object Text Recrod
    o End Record
 
-
  */
 
 #include "bfd.h"
 #include "libbfd.h"
 #include "libiberty.h"
 
-
 static boolean versados_mkobject PARAMS ((bfd *));
 static boolean versados_scan PARAMS ((bfd *));
 static const bfd_target *versados_object_p PARAMS ((bfd *));
 
-
 #define VHEADER '1'
 #define VESTDEF '2'
 #define VOTR '3'
 #define VEND '4'
 
-
 #define ES_BASE 17             /* first symbol has esdid 17 */
 
 /* Per file target dependent information */
@@ -145,11 +141,7 @@ union ext_any
     struct ext_otr otr;
   };
 
-/* Initialize by filling in the hex conversion array. */
-
-
-
-
+/* Initialize by filling in the hex conversion array.  */
 
 /* Set up the tdata information.  */
 
@@ -171,13 +163,10 @@ versados_mkobject (abfd)
   return true;
 }
 
-
 /* Report a problem in an S record file.  FIXME: This probably should
    not call fprintf, but we really do need some mechanism for printing
    error messages.  */
 
-
-
 static asymbol *
 versados_new_symbol (abfd, snum, name, val, sec)
      bfd *abfd;
@@ -195,7 +184,6 @@ versados_new_symbol (abfd, snum, name, val, sec)
   return n;
 }
 
-
 static int
 get_record (abfd, ptr)
      bfd *abfd;
@@ -244,7 +232,6 @@ new_symbol_string (abfd, name)
   return n;
 }
 
-
 static void
 process_esd (abfd, esd, pass)
      bfd *abfd;
@@ -296,7 +283,6 @@ process_esd (abfd, esd, pass)
          }
          break;
 
-
        case ESD_ABS:
          size = get_4 (&ptr);
          start = get_4 (&ptr);
@@ -356,7 +342,6 @@ reloc_howto_type versados_howto_table[] =
         "-v32", true, 0xffffffff, 0xffffffff, false),
 };
 
-
 static int
 get_offset (len, ptr)
      int len;
@@ -405,7 +390,6 @@ process_otr (abfd, otr, pass)
          int offsetlen = flag & 0x7;
          int j;
 
-
          if (esdids == 0)
            {
              /* A zero esdid means the new pc is the offset given */
@@ -433,7 +417,7 @@ process_otr (abfd, otr, pass)
                      int rn = EDATA (abfd, otr->esdid - 1).relocs++;
                      if (pass == 1)
                        {
-                         /* this is the first pass over the data, 
+                         /* this is the first pass over the data,
                             just remember that we need a reloc */
                        }
                      else
@@ -471,7 +455,6 @@ process_otr (abfd, otr, pass)
   if (!contents && need_contents)
     esdid->contents = (unsigned char *) bfd_alloc (abfd, esdid->section->_raw_size);
 
-
 }
 
 static boolean
@@ -483,10 +466,12 @@ versados_scan (abfd)
   int j;
   int nsecs = 0;
 
+  VDATA (abfd)->stringlen = 0;
   VDATA (abfd)->nrefs = 0;
   VDATA (abfd)->ndefs = 0;
   VDATA (abfd)->ref_idx = 0;
   VDATA (abfd)->def_idx = 0;
+  VDATA (abfd)->pass_2_done = 0;
 
   while (loop)
     {
@@ -584,8 +569,6 @@ versados_scan (abfd)
   return 1;
 }
 
-
-
 /* Check whether an existing file is a versados  file.  */
 
 static const bfd_target *
@@ -631,7 +614,6 @@ versados_object_p (abfd)
   return abfd->xvec;
 }
 
-
 static boolean
 versados_pass_2 (abfd)
      bfd *abfd;
@@ -646,7 +628,6 @@ versados_pass_2 (abfd)
 
   VDATA (abfd)->es_done = ES_BASE;
 
-
   /* read records till we get to where we want to be */
 
   while (1)
@@ -699,8 +680,6 @@ versados_set_section_contents (abfd, section, location, offset, bytes_to_do)
   return false;
 }
 
-
-/*ARGSUSED */
 static int
 versados_sizeof_headers (abfd, exec)
      bfd *abfd ATTRIBUTE_UNUSED;
@@ -753,7 +732,6 @@ versados_get_symtab (abfd, alocation)
   return symcount;
 }
 
-/*ARGSUSED */
 void
 versados_get_symbol_info (ignore_abfd, symbol, ret)
      bfd *ignore_abfd ATTRIBUTE_UNUSED;
@@ -763,7 +741,6 @@ versados_get_symbol_info (ignore_abfd, symbol, ret)
   bfd_symbol_info (symbol, ret);
 }
 
-/*ARGSUSED */
 void
 versados_print_symbol (ignore_abfd, afile, symbol, how)
      bfd *ignore_abfd ATTRIBUTE_UNUSED;
@@ -794,7 +771,6 @@ versados_get_reloc_upper_bound (abfd, asect)
   return (asect->reloc_count + 1) * sizeof (arelent *);
 }
 
-
 long
 versados_canonicalize_reloc (abfd, section, relptr, symbols)
      bfd *abfd;
@@ -864,6 +840,7 @@ versados_canonicalize_reloc (abfd, section, relptr, symbols)
   bfd_generic_get_relocated_section_contents
 #define versados_bfd_relax_section bfd_generic_relax_section
 #define versados_bfd_gc_sections bfd_generic_gc_sections
+#define versados_bfd_merge_sections bfd_generic_merge_sections
 #define versados_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
 #define versados_bfd_final_link _bfd_generic_final_link
@@ -920,6 +897,6 @@ const bfd_target versados_vec =
   BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic),
 
   NULL,
-  
+
   (PTR) 0
 };
This page took 0.210741 seconds and 4 git commands to generate.