* Makefile.in (SFILES): Add cp-names.y.
[deliverable/binutils-gdb.git] / bfd / aoutx.h
index 34a2870175601254598abe703d0c151384a1bf72..9bea98ea066f611097908b91f85786519d538ccb 100644 (file)
@@ -1,6 +1,6 @@
 /* BFD semi-generic back-end for a.out binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000,
-   2001, 2002, 2003, 2004
+   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+   2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
    Written by Cygnus Support.
 
@@ -654,14 +654,7 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p)
 #endif /* STAT_FOR_EXEC */
 
   if (result)
-    {
-#if 0 /* These should be set correctly anyways.  */
-      abfd->sections = obj_textsec (abfd);
-      obj_textsec (abfd)->next = obj_datasec (abfd);
-      obj_datasec (abfd)->next = obj_bsssec (abfd);
-#endif
-      return result;
-    }
+    return result;
 
  error_ret:
   bfd_release (abfd, rawptr);
@@ -917,9 +910,6 @@ adjust_o_magic (abfd, execp)
   /* Data.  */
   if (!obj_datasec (abfd)->user_set_vma)
     {
-#if 0      /* ?? Does alignment in the file image really matter?  */
-      pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma;
-#endif
       obj_textsec (abfd)->size += pad;
       pos += pad;
       vma += pad;
@@ -934,9 +924,6 @@ adjust_o_magic (abfd, execp)
   /* BSS.  */
   if (!obj_bsssec (abfd)->user_set_vma)
     {
-#if 0
-      pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
-#endif
       obj_datasec (abfd)->size += pad;
       pos += pad;
       vma += pad;
@@ -1509,88 +1496,6 @@ translate_from_native_sym_flags (abfd, cache_ptr)
        /* This code is no longer needed.  It used to be used to make
            the linker handle set symbols, but they are now handled in
            the add_symbols routine instead.  */
-#if 0
-       asection *section;
-       arelent_chain *reloc;
-       asection *into_section;
-       bfd_size_type amt;
-
-       /* This is a set symbol.  The name of the symbol is the name
-          of the set (e.g., __CTOR_LIST__).  The value of the symbol
-          is the value to add to the set.  We create a section with
-          the same name as the symbol, and add a reloc to insert the
-          appropriate value into the section.
-
-          This action is actually obsolete; it used to make the
-          linker do the right thing, but the linker no longer uses
-          this function.  */
-
-       section = bfd_get_section_by_name (abfd, cache_ptr->symbol.name);
-       if (section == NULL)
-         {
-           char *copy;
-
-           amt = strlen (cache_ptr->symbol.name) + 1;
-           copy = bfd_alloc (abfd, amt);
-           if (copy == NULL)
-             return FALSE;
-
-           strcpy (copy, cache_ptr->symbol.name);
-           section = bfd_make_section (abfd, copy);
-           if (section == NULL)
-             return FALSE;
-         }
-
-       amt = sizeof (arelent_chain);
-       reloc = (arelent_chain *) bfd_alloc (abfd, amt);
-       if (reloc == NULL)
-         return FALSE;
-
-       /* Build a relocation entry for the constructor.  */
-       switch (cache_ptr->type & N_TYPE)
-         {
-         case N_SETA:
-           into_section = bfd_abs_section_ptr;
-           cache_ptr->type = N_ABS;
-           break;
-         case N_SETT:
-           into_section = obj_textsec (abfd);
-           cache_ptr->type = N_TEXT;
-           break;
-         case N_SETD:
-           into_section = obj_datasec (abfd);
-           cache_ptr->type = N_DATA;
-           break;
-         case N_SETB:
-           into_section = obj_bsssec (abfd);
-           cache_ptr->type = N_BSS;
-           break;
-         }
-
-       /* Build a relocation pointing into the constructor section
-          pointing at the symbol in the set vector specified.  */
-       reloc->relent.addend = cache_ptr->symbol.value;
-       cache_ptr->symbol.section = into_section;
-       reloc->relent.sym_ptr_ptr = into_section->symbol_ptr_ptr;
-
-       /* We modify the symbol to belong to a section depending upon
-          the name of the symbol, and add to the size of the section
-          to contain a pointer to the symbol. Build a reloc entry to
-          relocate to this symbol attached to this section.  */
-       section->flags = SEC_CONSTRUCTOR | SEC_RELOC;
-
-       section->reloc_count++;
-       section->alignment_power = 2;
-
-       reloc->next = section->constructor_chain;
-       section->constructor_chain = reloc;
-       reloc->relent.address = section->size;
-       section->size += BYTES_IN_WORD;
-
-       reloc->relent.howto = CTOR_TABLE_RELOC_HOWTO (abfd);
-
-#endif /* 0 */
-
        switch (cache_ptr->type & N_TYPE)
          {
          case N_SETA:
@@ -2077,11 +1982,6 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr)
   r_jmptable = (g->howto->type & 16) != 0;
   r_relative = (g->howto->type & 32) != 0;
 
-#if 0
-  /* For a standard reloc, the addend is in the object file.  */
-  r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma;
-#endif
-
   /* Name was clobbered by aout_write_syms to be symbol index.  */
 
   /* If this relocation is relative to a symbol then set the
@@ -2848,7 +2748,7 @@ NAME(aout,find_nearest_line)
              /* Look ahead to next symbol to check if that too is an N_SO.  */
              p++;
              if (*p == NULL)
-               break;
+               goto done;
              q = (aout_symbol_type *) (*p);
              if (q->type != (int)N_SO)
                goto next;
@@ -3530,8 +3430,9 @@ aout_link_add_symbols (abfd, info)
          break;
        case N_WARNING:
          /* A warning symbol.  The next symbol is the one to warn
-            about.  */
-         BFD_ASSERT (p + 1 < pend);
+            about.  If there is no next symbol, just look away.  */
+         if (p + 1 >= pend)
+           return TRUE;
          ++p;
          string = name;
          name = strings + GET_WORD (abfd, p->e_strx);
This page took 0.025125 seconds and 4 git commands to generate.