daily update
[deliverable/binutils-gdb.git] / bfd / ieee.c
index f0ba1e5b1158a4c1f128da3536213c3f65cb49d1..2b1ed532fe9d3691946dbb23cb9bac8ff34cf3cb 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD back-end for ieee-695 objects.
    Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003
+   2000, 2001, 2002, 2003, 2004
    Free Software Foundation, Inc.
 
    Written by Steve Chamberlain of Cygnus Support.
@@ -80,7 +80,7 @@ static bfd_boolean ieee_slurp_symbol_table
   PARAMS ((bfd *));
 static long ieee_get_symtab_upper_bound
   PARAMS ((bfd *));
-static long ieee_get_symtab
+static long ieee_canonicalize_symtab
   PARAMS ((bfd *, asymbol **));
 static asection *get_section_entry
   PARAMS ((bfd *, ieee_data_type *i, unsigned int));
@@ -160,7 +160,7 @@ static bfd_boolean ieee_write_data_part
 static bfd_boolean init_for_output
   PARAMS ((bfd *));
 static bfd_boolean ieee_set_section_contents
-  PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type));
+  PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type));
 static bfd_boolean ieee_write_external_part
   PARAMS ((bfd *));
 static bfd_boolean ieee_write_me_part
@@ -704,7 +704,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section)
          next_byte (&(ieee->h));
          PUSH (NOSYMBOL,
                0,
-               ieee->section_table[must_parse_int (&(ieee->h))]->_raw_size);
+               ieee->section_table[must_parse_int (&(ieee->h))]->size);
          break;
        case ieee_variable_I_enum:
          /* Push the address of variable n.  */
@@ -935,9 +935,8 @@ ieee_slurp_external_symbols (abfd)
                    break;
                  default:
                    (*_bfd_error_handler)
-                     (_("%s: unimplemented ATI record %u for symbol %u"),
-                      bfd_archive_filename (abfd), symbol_attribute_def,
-                      symbol_name_index);
+                     (_("%B: unimplemented ATI record %u for symbol %u"),
+                      abfd, symbol_attribute_def, symbol_name_index);
                    bfd_set_error (bfd_error_bad_value);
                    return FALSE;
                    break;
@@ -960,8 +959,8 @@ ieee_slurp_external_symbols (abfd)
                if (value != 0x3f)
                  {
                    (*_bfd_error_handler)
-                     (_("%s: unexpected ATN type %d in external part"),
-                        bfd_archive_filename (abfd), (int) value);
+                     (_("%B: unexpected ATN type %d in external part"),
+                        abfd, (int) value);
                    bfd_set_error (bfd_error_bad_value);
                    return FALSE;
                  }
@@ -982,8 +981,7 @@ ieee_slurp_external_symbols (abfd)
 
                      default:
                        (*_bfd_error_handler)
-                         (_("%s: unexpected type after ATN"),
-                            bfd_archive_filename (abfd));
+                         (_("%B: unexpected type after ATN"), abfd);
                        bfd_set_error (bfd_error_bad_value);
                        return FALSE;
                      }
@@ -1021,7 +1019,7 @@ ieee_slurp_external_symbols (abfd)
                val = symbol->symbol.value;
                for (s = abfd->sections; s != NULL; s = s->next)
                  {
-                   if (val >= s->vma && val < s->vma + s->_raw_size)
+                   if (val >= s->vma && val < s->vma + s->size)
                      {
                        symbol->symbol.section = s;
                        symbol->symbol.value -= s->vma;
@@ -1043,7 +1041,7 @@ ieee_slurp_external_symbols (abfd)
            (void) must_parse_int (&(ieee->h));
            /* Fetch the default size if not resolved.  */
            size = must_parse_int (&(ieee->h));
-           /* Fetch the defautlt value if available.  */
+           /* Fetch the default value if available.  */
            if (! parse_int (&(ieee->h), &value))
              {
                value = 0;
@@ -1145,7 +1143,7 @@ ieee_get_symtab_upper_bound (abfd)
 extern const bfd_target ieee_vec;
 
 static long
-ieee_get_symtab (abfd, location)
+ieee_canonicalize_symtab (abfd, location)
      bfd *abfd;
      asymbol **location;
 {
@@ -1378,11 +1376,11 @@ ieee_slurp_sections (abfd)
                  {
                  case ieee_section_size_enum:
                    section = ieee->section_table[must_parse_int (&(ieee->h))];
-                   section->_raw_size = must_parse_int (&(ieee->h));
+                   section->size = must_parse_int (&(ieee->h));
                    break;
                  case ieee_physical_region_size_enum:
                    section = ieee->section_table[must_parse_int (&(ieee->h))];
-                   section->_raw_size = must_parse_int (&(ieee->h));
+                   section->size = must_parse_int (&(ieee->h));
                    break;
                  case ieee_region_base_address_enum:
                    section = ieee->section_table[must_parse_int (&(ieee->h))];
@@ -1441,7 +1439,7 @@ ieee_slurp_debug (abfd)
   sec->filepos = ieee->w.r.debug_information_part;
 
   debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part);
-  sec->_raw_size = debug_end - ieee->w.r.debug_information_part;
+  sec->size = debug_end - ieee->w.r.debug_information_part;
 
   return TRUE;
 }
@@ -1639,7 +1637,7 @@ ieee_object_p (abfd)
     const bfd_arch_info_type *arch;
     char family[10];
 
-    /* IEEE does not specify the format of the processor identificaton
+    /* IEEE does not specify the format of the processor identification
        string, so the compiler is free to put in it whatever it wants.
        We try here to recognize different processors belonging to the
        m68k family.  Code for other processors can be added here.  */
@@ -1803,10 +1801,6 @@ ieee_print_symbol (abfd, afile, symbol, how)
       fprintf (file, "%s", symbol->name);
       break;
     case bfd_print_symbol_more:
-#if 0
-      fprintf (file, "%4x %2x", aout_symbol (symbol)->desc & 0xffff,
-              aout_symbol (symbol)->other & 0xff);
-#endif
       BFD_FAIL ();
       break;
     case bfd_print_symbol_all:
@@ -2060,7 +2054,7 @@ ieee_slurp_section_data (abfd)
       ieee_per_section_type *per = ieee_per_section (s);
       if ((s->flags & SEC_DEBUGGING) != 0)
        continue;
-      per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size);
+      per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->size);
       if (!per->data)
        return FALSE;
       per->reloc_tail_ptr =
@@ -2106,7 +2100,7 @@ ieee_slurp_section_data (abfd)
                                  &pcrel, &extra,
                                  0);
                current_map->pc = value;
-               BFD_ASSERT ((unsigned) (value - s->vma) <= s->_raw_size);
+               BFD_ASSERT ((unsigned) (value - s->vma) <= s->size);
              }
              break;
 
@@ -2318,11 +2312,6 @@ ieee_write_section_part (abfd)
 
          if (! ieee_write_id (abfd, s->name))
            return FALSE;
-#if 0
-         ieee_write_int (abfd, 0);     /* Parent */
-         ieee_write_int (abfd, 0);     /* Brother */
-         ieee_write_int (abfd, 0);     /* Context */
-#endif
          /* Alignment.  */
          if (! ieee_write_byte (abfd, ieee_section_alignment_enum)
              || ! ieee_write_byte (abfd,
@@ -2336,7 +2325,7 @@ ieee_write_section_part (abfd)
              || ! ieee_write_byte (abfd,
                                    (bfd_byte) (s->index
                                                + IEEE_SECTION_NUMBER_BASE))
-             || ! ieee_write_int (abfd, s->_raw_size))
+             || ! ieee_write_int (abfd, s->size))
            return FALSE;
          if (abfd->flags & EXEC_P)
            {
@@ -2398,14 +2387,14 @@ do_with_relocs (abfd, s)
     {
       /* If there aren't any relocations then output the load constant
         byte opcode rather than the load with relocation opcode.  */
-      while (current_byte_index < s->_raw_size)
+      while (current_byte_index < s->size)
        {
          bfd_size_type run;
          unsigned int MAXRUN = 127;
 
          run = MAXRUN;
-         if (run > s->_raw_size - current_byte_index)
-           run = s->_raw_size - current_byte_index;
+         if (run > s->size - current_byte_index)
+           run = s->size - current_byte_index;
 
          if (run != 0)
            {
@@ -2433,11 +2422,11 @@ do_with_relocs (abfd, s)
       if ((PTR) stream == (PTR) NULL)
        {
          /* Outputting a section without data, fill it up.  */
-         stream = (unsigned char *) bfd_zalloc (abfd, s->_raw_size);
+         stream = (unsigned char *) bfd_zalloc (abfd, s->size);
          if (!stream)
            return FALSE;
        }
-      while (current_byte_index < s->_raw_size)
+      while (current_byte_index < s->size)
        {
          bfd_size_type run;
          unsigned int MAXRUN = 127;
@@ -2451,8 +2440,8 @@ do_with_relocs (abfd, s)
          else
            run = MAXRUN;
 
-         if (run > s->_raw_size - current_byte_index)
-           run = s->_raw_size - current_byte_index;
+         if (run > s->size - current_byte_index)
+           run = s->size - current_byte_index;
 
          if (run != 0)
            {
@@ -2473,10 +2462,6 @@ do_with_relocs (abfd, s)
                {
                  arelent *r = *p;
                  bfd_signed_vma ov;
-#if 0
-                 if (r->howto->pc_relative)
-                   r->addend += current_byte_index;
-#endif
                  switch (r->howto->size)
                    {
                    case 2:
@@ -2561,7 +2546,7 @@ do_as_repeat (abfd, s)
      bfd *abfd;
      asection *s;
 {
-  if (s->_raw_size)
+  if (s->size)
     {
       if (! ieee_write_byte (abfd, ieee_set_current_section_enum)
          || ! ieee_write_byte (abfd,
@@ -2586,7 +2571,7 @@ do_as_repeat (abfd, s)
        }
 
       if (! ieee_write_byte (abfd, ieee_repeat_data_enum)
-         || ! ieee_write_int (abfd, s->_raw_size)
+         || ! ieee_write_int (abfd, s->size)
          || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum)
          || ! ieee_write_byte (abfd, 1)
          || ! ieee_write_byte (abfd, 0))
@@ -2612,7 +2597,7 @@ do_without_relocs (abfd, s)
     {
       unsigned int i;
 
-      for (i = 0; i < s->_raw_size; i++)
+      for (i = 0; i < s->size; i++)
        {
          if (stream[i] != 0)
            {
@@ -3342,7 +3327,7 @@ ieee_write_debug_part (abfd)
        }
 
       ieee->w.r.debug_information_part = here;
-      if (bfd_bwrite (s->contents, s->_raw_size, abfd) != s->_raw_size)
+      if (bfd_bwrite (s->contents, s->size, abfd) != s->size)
        return FALSE;
     }
   else
@@ -3420,9 +3405,9 @@ init_for_output (abfd)
     {
       if ((s->flags & SEC_DEBUGGING) != 0)
        continue;
-      if (s->_raw_size != 0)
+      if (s->size != 0)
        {
-         bfd_size_type size = s->_raw_size;
+         bfd_size_type size = s->size;
          ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, size));
          if (!ieee_per_section (s)->data)
            return FALSE;
@@ -3440,7 +3425,7 @@ static bfd_boolean
 ieee_set_section_contents (abfd, section, location, offset, count)
      bfd *abfd;
      sec_ptr section;
-     PTR location;
+     const PTR location;
      file_ptr offset;
      bfd_size_type count;
 {
@@ -3448,7 +3433,7 @@ ieee_set_section_contents (abfd, section, location, offset, count)
     {
       if (section->contents == NULL)
        {
-         bfd_size_type size = section->_raw_size;
+         bfd_size_type size = section->size;
          section->contents = (unsigned char *) bfd_alloc (abfd, size);
          if (section->contents == NULL)
            return FALSE;
@@ -3704,6 +3689,7 @@ ieee_write_processor (abfd)
          case bfd_mach_mcf5206e:id = "5206e"; break;
          case bfd_mach_mcf5307:id = "5307";  break;
          case bfd_mach_mcf5407:id = "5407";  break;
+         case bfd_mach_mcf528x:id = "5282";  break;
          }
 
        if (! ieee_write_id (abfd, id))
@@ -3939,68 +3925,6 @@ ieee_sizeof_headers (abfd, x)
   return 0;
 }
 
-
-/* The debug info routines are never used.  */
-#if 0
-
-static void
-ieee_bfd_debug_info_start (abfd)
-     bfd *abfd;
-{
-
-}
-
-static void
-ieee_bfd_debug_info_end (abfd)
-     bfd *abfd;
-{
-
-}
-
-
-/* Add this section to the list of sections we have debug info for, to
-   be ready to output it at close time.  */
-static void
-ieee_bfd_debug_info_accumulate (abfd, section)
-     bfd *abfd;
-     asection *section;
-{
-  ieee_data_type *ieee = IEEE_DATA (section->owner);
-  ieee_data_type *output_ieee = IEEE_DATA (abfd);
-
-  /* Can only accumulate data from other ieee bfds.  */
-  if (section->owner->xvec != abfd->xvec)
-    return;
-  /* Only bother once per bfd.  */
-  if (ieee->done_debug)
-    return;
-  ieee->done_debug = TRUE;
-
-  /* Don't bother if there is no debug info.  */
-  if (ieee->w.r.debug_information_part == 0)
-    return;
-
-  /* Add to chain.  */
-  {
-    bfd_size_type amt = sizeof (bfd_chain_type);
-    bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, amt);
-
-    if (!n)
-      abort ();                /* FIXME */
-    n->this = section->owner;
-    n->next = (bfd_chain_type *) NULL;
-
-    if (output_ieee->chain_head)
-      output_ieee->chain_head->next = n;
-    else
-      output_ieee->chain_root = n;
-
-    output_ieee->chain_head = n;
-  }
-}
-
-#endif
-
 #define        ieee_close_and_cleanup _bfd_generic_close_and_cleanup
 #define ieee_bfd_free_cached_info _bfd_generic_bfd_free_cached_info
 
@@ -4019,6 +3943,8 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 #define ieee_update_armap_timestamp bfd_true
 #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
 
+#define ieee_bfd_is_target_special_symbol  \
+  ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
 #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ieee_get_lineno _bfd_nosymbols_get_lineno
 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
@@ -4036,7 +3962,10 @@ ieee_bfd_debug_info_accumulate (abfd, section)
 #define ieee_bfd_relax_section bfd_generic_relax_section
 #define ieee_bfd_gc_sections bfd_generic_gc_sections
 #define ieee_bfd_merge_sections bfd_generic_merge_sections
+#define ieee_bfd_is_group_section bfd_generic_is_group_section
 #define ieee_bfd_discard_group bfd_generic_discard_group
+#define ieee_section_already_linked \
+  _bfd_generic_section_already_linked
 #define ieee_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
 #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
@@ -4097,10 +4026,11 @@ const bfd_target ieee_vec =
      ieee_update_armap_timestamp  */
   BFD_JUMP_TABLE_ARCHIVE (ieee),
 
-  /* ieee_get_symtab_upper_bound, ieee_get_symtab, ieee_make_empty_symbol,
-     ieee_print_symbol, ieee_get_symbol_info, ieee_bfd_is_local_label_name,
-     ieee_get_lineno, ieee_find_nearest_line, ieee_bfd_make_debug_symbol,
-     ieee_read_minisymbols, ieee_minisymbol_to_symbol  */
+  /* ieee_get_symtab_upper_bound, ieee_canonicalize_symtab,
+     ieee_make_empty_symbol, ieee_print_symbol, ieee_get_symbol_info,
+     ieee_bfd_is_local_label_name, ieee_get_lineno,
+     ieee_find_nearest_line, ieee_bfd_make_debug_symbol,
+     ieee_read_minisymbols, ieee_minisymbol_to_symbol */
   BFD_JUMP_TABLE_SYMBOLS (ieee),
 
   /* ieee_get_reloc_upper_bound, ieee_canonicalize_reloc,
This page took 0.030399 seconds and 4 git commands to generate.