Update year range in copyright notice of binutils files
[deliverable/binutils-gdb.git] / bfd / aoutx.h
index 1efb71512058620e7f9ada36852886b72052b716..6dc4c68678e4ccb77f16aba7c790116bb4f217e3 100644 (file)
@@ -1,7 +1,5 @@
 /* BFD semi-generic back-end for a.out binaries.
-   Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1990-2018 Free Software Foundation, Inc.
    Written by Cygnus Support.
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -68,12 +66,12 @@ DESCRIPTION
        from @file{sunos.c}:
 
 |      #define TARGET_NAME "a.out-sunos-big"
-|      #define VECNAME    sunos_big_vec
+|      #define VECNAME    sparc_aout_sunos_be_vec
 |      #include "aoutf1.h"
 
        requires all the names from @file{aout32.c}, and produces the jump vector
 
-|      sunos_big_vec
+|      sparc_aout_sunos_be_vec
 
        The file @file{host-aout.c} is a special case.  It is for a large set
        of hosts that use ``more or less standard'' a.out files, and
@@ -103,7 +101,7 @@ DESCRIPTION
 |      TDEFAULTS = -DDEFAULT_VECTOR=host_aout_big_vec
 |      TDEPFILES= host-aout.o trad-core.o
 
-       in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in}
+       in the @file{config/@var{XXX}.mt} file, and modify @file{configure.ac}
        to use the
        @file{@var{XXX}.mt} file (by setting "<<bfd_target=XXX>>") when your
        configuration is selected.  */
@@ -180,59 +178,59 @@ DESCRIPTION
 
 reloc_howto_type howto_table_ext[] =
 {
-  /*     Type         rs   size bsz  pcrel bitpos ovrf                  sf name          part_inpl readmask setmask pcdone.  */
-  HOWTO (RELOC_8,       0,  0,  8,  FALSE, 0, complain_overflow_bitfield, 0, "8",           FALSE, 0, 0x000000ff, FALSE),
-  HOWTO (RELOC_16,      0,  1,         16, FALSE, 0, complain_overflow_bitfield, 0, "16",          FALSE, 0, 0x0000ffff, FALSE),
-  HOWTO (RELOC_32,      0,  2,         32, FALSE, 0, complain_overflow_bitfield, 0, "32",          FALSE, 0, 0xffffffff, FALSE),
-  HOWTO (RELOC_DISP8,   0,  0,         8,  TRUE,  0, complain_overflow_signed,   0, "DISP8",       FALSE, 0, 0x000000ff, FALSE),
-  HOWTO (RELOC_DISP16,  0,  1,         16, TRUE,  0, complain_overflow_signed,   0, "DISP16",      FALSE, 0, 0x0000ffff, FALSE),
-  HOWTO (RELOC_DISP32,  0,  2,         32, TRUE,  0, complain_overflow_signed,   0, "DISP32",      FALSE, 0, 0xffffffff, FALSE),
-  HOWTO (RELOC_WDISP30, 2,  2,         30, TRUE,  0, complain_overflow_signed,   0, "WDISP30",     FALSE, 0, 0x3fffffff, FALSE),
-  HOWTO (RELOC_WDISP22, 2,  2,         22, TRUE,  0, complain_overflow_signed,   0, "WDISP22",     FALSE, 0, 0x003fffff, FALSE),
-  HOWTO (RELOC_HI22,   10,  2,         22, FALSE, 0, complain_overflow_bitfield, 0, "HI22",        FALSE, 0, 0x003fffff, FALSE),
-  HOWTO (RELOC_22,      0,  2,         22, FALSE, 0, complain_overflow_bitfield, 0, "22",          FALSE, 0, 0x003fffff, FALSE),
-  HOWTO (RELOC_13,      0,  2,         13, FALSE, 0, complain_overflow_bitfield, 0, "13",          FALSE, 0, 0x00001fff, FALSE),
-  HOWTO (RELOC_LO10,    0,  2,         10, FALSE, 0, complain_overflow_dont,     0, "LO10",        FALSE, 0, 0x000003ff, FALSE),
-  HOWTO (RELOC_SFA_BASE,0,  2,         32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_BASE",    FALSE, 0, 0xffffffff, FALSE),
-  HOWTO (RELOC_SFA_OFF13,0, 2,         32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_OFF13",   FALSE, 0, 0xffffffff, FALSE),
-  HOWTO (RELOC_BASE10,  0,  2,         10, FALSE, 0, complain_overflow_dont,     0, "BASE10",      FALSE, 0, 0x000003ff, FALSE),
-  HOWTO (RELOC_BASE13,  0,  2, 13, FALSE, 0, complain_overflow_signed,   0, "BASE13",      FALSE, 0, 0x00001fff, FALSE),
-  HOWTO (RELOC_BASE22, 10,  2, 22, FALSE, 0, complain_overflow_bitfield, 0, "BASE22",      FALSE, 0, 0x003fffff, FALSE),
-  HOWTO (RELOC_PC10,    0,  2, 10, TRUE,  0, complain_overflow_dont,     0, "PC10",        FALSE, 0, 0x000003ff, TRUE),
-  HOWTO (RELOC_PC22,   10,  2, 22, TRUE,  0, complain_overflow_signed,   0, "PC22",        FALSE, 0, 0x003fffff, TRUE),
-  HOWTO (RELOC_JMP_TBL, 2,  2,         30, TRUE,  0, complain_overflow_signed,   0, "JMP_TBL",     FALSE, 0, 0x3fffffff, FALSE),
+  /*    Type         rs   size bsz  pcrel bitpos ovrf                  sf name          part_inpl readmask setmask pcdone.  */
+  HOWTO (RELOC_8,      0,  0,  8,  FALSE, 0, complain_overflow_bitfield, 0, "8",           FALSE, 0, 0x000000ff, FALSE),
+  HOWTO (RELOC_16,     0,  1,  16, FALSE, 0, complain_overflow_bitfield, 0, "16",          FALSE, 0, 0x0000ffff, FALSE),
+  HOWTO (RELOC_32,     0,  2,  32, FALSE, 0, complain_overflow_bitfield, 0, "32",          FALSE, 0, 0xffffffff, FALSE),
+  HOWTO (RELOC_DISP8,  0,  0,  8,  TRUE,  0, complain_overflow_signed,   0, "DISP8",       FALSE, 0, 0x000000ff, FALSE),
+  HOWTO (RELOC_DISP16, 0,  1,  16, TRUE,  0, complain_overflow_signed,   0, "DISP16",      FALSE, 0, 0x0000ffff, FALSE),
+  HOWTO (RELOC_DISP32, 0,  2,  32, TRUE,  0, complain_overflow_signed,   0, "DISP32",      FALSE, 0, 0xffffffff, FALSE),
+  HOWTO (RELOC_WDISP30, 2,  2, 30, TRUE,  0, complain_overflow_signed,   0, "WDISP30",     FALSE, 0, 0x3fffffff, FALSE),
+  HOWTO (RELOC_WDISP22, 2,  2, 22, TRUE,  0, complain_overflow_signed,   0, "WDISP22",     FALSE, 0, 0x003fffff, FALSE),
+  HOWTO (RELOC_HI22,   10,  2, 22, FALSE, 0, complain_overflow_bitfield, 0, "HI22",        FALSE, 0, 0x003fffff, FALSE),
+  HOWTO (RELOC_22,     0,  2,  22, FALSE, 0, complain_overflow_bitfield, 0, "22",          FALSE, 0, 0x003fffff, FALSE),
+  HOWTO (RELOC_13,     0,  2,  13, FALSE, 0, complain_overflow_bitfield, 0, "13",          FALSE, 0, 0x00001fff, FALSE),
+  HOWTO (RELOC_LO10,   0,  2,  10, FALSE, 0, complain_overflow_dont,     0, "LO10",        FALSE, 0, 0x000003ff, FALSE),
+  HOWTO (RELOC_SFA_BASE,0,  2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_BASE",    FALSE, 0, 0xffffffff, FALSE),
+  HOWTO (RELOC_SFA_OFF13,0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "SFA_OFF13",   FALSE, 0, 0xffffffff, FALSE),
+  HOWTO (RELOC_BASE10, 0,  2,  10, FALSE, 0, complain_overflow_dont,     0, "BASE10",      FALSE, 0, 0x000003ff, FALSE),
+  HOWTO (RELOC_BASE13, 0,  2,  13, FALSE, 0, complain_overflow_signed,   0, "BASE13",      FALSE, 0, 0x00001fff, FALSE),
+  HOWTO (RELOC_BASE22, 10,  2, 22, FALSE, 0, complain_overflow_bitfield, 0, "BASE22",      FALSE, 0, 0x003fffff, FALSE),
+  HOWTO (RELOC_PC10,   0,  2,  10, TRUE,  0, complain_overflow_dont,     0, "PC10",        FALSE, 0, 0x000003ff, TRUE),
+  HOWTO (RELOC_PC22,   10,  2, 22, TRUE,  0, complain_overflow_signed,   0, "PC22",        FALSE, 0, 0x003fffff, TRUE),
+  HOWTO (RELOC_JMP_TBL, 2,  2, 30, TRUE,  0, complain_overflow_signed,   0, "JMP_TBL",     FALSE, 0, 0x3fffffff, FALSE),
   HOWTO (RELOC_SEGOFF16,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "SEGOFF16",    FALSE, 0, 0x00000000, FALSE),
   HOWTO (RELOC_GLOB_DAT,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "GLOB_DAT",    FALSE, 0, 0x00000000, FALSE),
   HOWTO (RELOC_JMP_SLOT,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "JMP_SLOT",    FALSE, 0, 0x00000000, FALSE),
   HOWTO (RELOC_RELATIVE,0,  2, 0,  FALSE, 0, complain_overflow_bitfield, 0, "RELATIVE",    FALSE, 0, 0x00000000, FALSE),
-  HOWTO (0,             0,  0,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
-  HOWTO (0,             0,  0,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+  HOWTO (0,            0,  3,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
+  HOWTO (0,            0,  3,  0,  FALSE, 0, complain_overflow_dont,     0, "R_SPARC_NONE",FALSE, 0, 0x00000000, TRUE),
 #define RELOC_SPARC_REV32 RELOC_WDISP19
-  HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,   0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
+  HOWTO (RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,          0,"R_SPARC_REV32",FALSE, 0, 0xffffffff, FALSE),
 };
 
 /* Convert standard reloc records to "arelent" format (incl byte swap).  */
 
 reloc_howto_type howto_table_std[] =
 {
-  /* type              rs size bsz  pcrel bitpos ovrf                     sf name     part_inpl readmask  setmask    pcdone.  */
-HOWTO ( 0,            0,  0,   8,  FALSE, 0, complain_overflow_bitfield,0,"8",         TRUE, 0x000000ff,0x000000ff, FALSE),
-HOWTO ( 1,            0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"16",        TRUE, 0x0000ffff,0x0000ffff, FALSE),
-HOWTO ( 2,            0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"32",        TRUE, 0xffffffff,0xffffffff, FALSE),
-HOWTO ( 3,            0,  4,   64, FALSE, 0, complain_overflow_bitfield,0,"64",        TRUE, 0xdeaddead,0xdeaddead, FALSE),
-HOWTO ( 4,            0,  0,   8,  TRUE,  0, complain_overflow_signed,  0,"DISP8",     TRUE, 0x000000ff,0x000000ff, FALSE),
-HOWTO ( 5,            0,  1,   16, TRUE,  0, complain_overflow_signed,  0,"DISP16",    TRUE, 0x0000ffff,0x0000ffff, FALSE),
-HOWTO ( 6,            0,  2,   32, TRUE,  0, complain_overflow_signed,  0,"DISP32",    TRUE, 0xffffffff,0xffffffff, FALSE),
-HOWTO ( 7,            0,  4,   64, TRUE,  0, complain_overflow_signed,  0,"DISP64",    TRUE, 0xfeedface,0xfeedface, FALSE),
-HOWTO ( 8,            0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL",   FALSE,         0,0x00000000, FALSE),
-HOWTO ( 9,            0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"BASE16",    FALSE,0xffffffff,0xffffffff, FALSE),
-HOWTO (10,            0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"BASE32",    FALSE,0xffffffff,0xffffffff, FALSE),
+  /* type             rs size bsz  pcrel bitpos ovrf                     sf name     part_inpl readmask  setmask    pcdone.  */
+HOWTO ( 0,            0,  0,   8,  FALSE, 0, complain_overflow_bitfield,0,"8",         TRUE, 0x000000ff,0x000000ff, FALSE),
+HOWTO ( 1,            0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"16",        TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO ( 2,            0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"32",        TRUE, 0xffffffff,0xffffffff, FALSE),
+HOWTO ( 3,            0,  4,   64, FALSE, 0, complain_overflow_bitfield,0,"64",        TRUE, 0xdeaddead,0xdeaddead, FALSE),
+HOWTO ( 4,            0,  0,   8,  TRUE,  0, complain_overflow_signed,  0,"DISP8",     TRUE, 0x000000ff,0x000000ff, FALSE),
+HOWTO ( 5,            0,  1,   16, TRUE,  0, complain_overflow_signed,  0,"DISP16",    TRUE, 0x0000ffff,0x0000ffff, FALSE),
+HOWTO ( 6,            0,  2,   32, TRUE,  0, complain_overflow_signed,  0,"DISP32",    TRUE, 0xffffffff,0xffffffff, FALSE),
+HOWTO ( 7,            0,  4,   64, TRUE,  0, complain_overflow_signed,  0,"DISP64",    TRUE, 0xfeedface,0xfeedface, FALSE),
+HOWTO ( 8,            0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL",   FALSE,         0,0x00000000, FALSE),
+HOWTO ( 9,            0,  1,   16, FALSE, 0, complain_overflow_bitfield,0,"BASE16",    FALSE,0xffffffff,0xffffffff, FALSE),
+HOWTO (10,            0,  2,   32, FALSE, 0, complain_overflow_bitfield,0,"BASE32",    FALSE,0xffffffff,0xffffffff, FALSE),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
-  HOWTO (16,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE,         0,0x00000000, FALSE),
+  HOWTO (16,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE,         0,0x00000000, FALSE),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
@@ -248,7 +246,7 @@ EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
-  HOWTO (32,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE",  FALSE,         0,0x00000000, FALSE),
+  HOWTO (32,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE",  FALSE,         0,0x00000000, FALSE),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
@@ -256,7 +254,7 @@ EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
 EMPTY_HOWTO (-1),
-  HOWTO (40,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL",   FALSE,         0,0x00000000, FALSE),
+  HOWTO (40,          0,  2,    0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL",   FALSE,         0,0x00000000, FALSE),
 };
 
 #define TABLE_SIZE(TABLE)      (sizeof (TABLE) / sizeof (TABLE[0]))
@@ -359,9 +357,9 @@ FUNCTION
 
 SYNOPSIS
        void aout_@var{size}_swap_exec_header_in,
-           (bfd *abfd,
-            struct external_exec *bytes,
-            struct internal_exec *execp);
+          (bfd *abfd,
+           struct external_exec *bytes,
+           struct internal_exec *execp);
 
 DESCRIPTION
        Swap the information in an executable header @var{raw_bytes} taken
@@ -444,7 +442,7 @@ FUNCTION
 SYNOPSIS
        const bfd_target *aout_@var{size}_some_aout_object_p
         (bfd *abfd,
-          struct internal_exec *execp,
+         struct internal_exec *execp,
          const bfd_target *(*callback_to_real_object_p) (bfd *));
 
 DESCRIPTION
@@ -490,27 +488,27 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
   /* Setting of EXEC_P has been deferred to the bottom of this function.  */
   if (execp->a_syms)
     abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS;
-  if (N_DYNAMIC (*execp))
+  if (N_DYNAMIC (execp))
     abfd->flags |= DYNAMIC;
 
-  if (N_MAGIC (*execp) == ZMAGIC)
+  if (N_MAGIC (execp) == ZMAGIC)
     {
       abfd->flags |= D_PAGED | WP_TEXT;
       adata (abfd).magic = z_magic;
     }
-  else if (N_MAGIC (*execp) == QMAGIC)
+  else if (N_MAGIC (execp) == QMAGIC)
     {
       abfd->flags |= D_PAGED | WP_TEXT;
       adata (abfd).magic = z_magic;
       adata (abfd).subformat = q_magic_format;
     }
-  else if (N_MAGIC (*execp) == NMAGIC)
+  else if (N_MAGIC (execp) == NMAGIC)
     {
       abfd->flags |= WP_TEXT;
       adata (abfd).magic = n_magic;
     }
-  else if (N_MAGIC (*execp) == OMAGIC
-          || N_MAGIC (*execp) == BMAGIC)
+  else if (N_MAGIC (execp) == OMAGIC
+          || N_MAGIC (execp) == BMAGIC)
     adata (abfd).magic = o_magic;
   else
     /* Should have been checked with N_BADMAG before this routine
@@ -565,28 +563,28 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
 
   struct exec *execp = exec_hdr (abfd);
 
-  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+  obj_textsec (abfd)->size = N_TXTSIZE (execp);
   /* Data and bss are already filled in since they're so standard.  */
 
   /* The virtual memory addresses of the sections.  */
-  obj_textsec (abfd)->vma = N_TXTADDR (*execp);
-  obj_datasec (abfd)->vma = N_DATADDR (*execp);
-  obj_bsssec  (abfd)->vma = N_BSSADDR (*execp);
+  obj_textsec (abfd)->vma = N_TXTADDR (execp);
+  obj_datasec (abfd)->vma = N_DATADDR (execp);
+  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
 
   /* The file offsets of the sections.  */
-  obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
-  obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+  obj_datasec (abfd)->filepos = N_DATOFF (execp);
 
   /* The file offsets of the relocation info.  */
-  obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
-  obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
 
   /* The file offsets of the string table and symbol table.  */
-  obj_str_filepos (abfd) = N_STROFF (*execp);
-  obj_sym_filepos (abfd) = N_SYMOFF (*execp);
+  obj_str_filepos (abfd) = N_STROFF (execp);
+  obj_sym_filepos (abfd) = N_SYMOFF (execp);
 
   /* Determine the architecture and machine type of the object file.  */
-  switch (N_MACHTYPE (*exec_hdr (abfd)))
+  switch (N_MACHTYPE (exec_hdr (abfd)))
     {
     default:
       abfd->obj_arch = bfd_arch_obscure;
@@ -639,12 +637,12 @@ NAME (aout, some_aout_object_p) (bfd *abfd,
       struct stat stat_buf;
 
       /* The original heuristic doesn't work in some important cases.
-        The a.out file has no information about the text start
-        address.  For files (like kernels) linked to non-standard
-        addresses (ld -Ttext nnn) the entry point may not be between
-        the default text start (obj_textsec(abfd)->vma) and
-        (obj_textsec(abfd)->vma) + text size.  This is not just a mach
-        issue.  Many kernels are loaded at non standard addresses.  */
+       The a.out file has no information about the text start
+       address.  For files (like kernels) linked to non-standard
+       addresses (ld -Ttext nnn) the entry point may not be between
+       the default text start (obj_textsec(abfd)->vma) and
+       (obj_textsec(abfd)->vma) + text size.  This is not just a mach
+       issue.  Many kernels are loaded at non standard addresses.  */
       if (abfd->iostream != NULL
          && (abfd->flags & BFD_IN_MEMORY) == 0
          && (fstat (fileno ((FILE *) (abfd->iostream)), &stat_buf) == 0)
@@ -703,7 +701,7 @@ SYNOPSIS
        enum machine_type  aout_@var{size}_machine_type
         (enum bfd_architecture arch,
          unsigned long machine,
-          bfd_boolean *unknown);
+         bfd_boolean *unknown);
 
 DESCRIPTION
        Keep track of machine architecture and machine type for
@@ -735,9 +733,21 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
          || machine == bfd_mach_sparc_v8plus
          || machine == bfd_mach_sparc_v8plusa
          || machine == bfd_mach_sparc_v8plusb
+         || machine == bfd_mach_sparc_v8plusc
+         || machine == bfd_mach_sparc_v8plusd
+         || machine == bfd_mach_sparc_v8pluse
+         || machine == bfd_mach_sparc_v8plusv
+         || machine == bfd_mach_sparc_v8plusm
+         || machine == bfd_mach_sparc_v8plusm8
          || machine == bfd_mach_sparc_v9
          || machine == bfd_mach_sparc_v9a
-         || machine == bfd_mach_sparc_v9b)
+         || machine == bfd_mach_sparc_v9b
+         || machine == bfd_mach_sparc_v9c
+         || machine == bfd_mach_sparc_v9d
+         || machine == bfd_mach_sparc_v9e
+         || machine == bfd_mach_sparc_v9v
+         || machine == bfd_mach_sparc_v9m
+         || machine == bfd_mach_sparc_v9m8)
        arch_flags = M_SPARC;
       else if (machine == bfd_mach_sparc_sparclet)
        arch_flags = M_SPARCLET;
@@ -793,9 +803,15 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
        case bfd_mach_mips16:
        case bfd_mach_mipsisa32:
        case bfd_mach_mipsisa32r2:
+       case bfd_mach_mipsisa32r3:
+       case bfd_mach_mipsisa32r5:
+       case bfd_mach_mipsisa32r6:
        case bfd_mach_mips5:
        case bfd_mach_mipsisa64:
        case bfd_mach_mipsisa64r2:
+       case bfd_mach_mipsisa64r3:
+       case bfd_mach_mipsisa64r5:
+       case bfd_mach_mipsisa64r6:
        case bfd_mach_mips_sb1:
        case bfd_mach_mips_xlr:
          /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc.  */
@@ -810,7 +826,7 @@ NAME (aout, machine_type) (enum bfd_architecture arch,
     case bfd_arch_ns32k:
       switch (machine)
        {
-       case 0:         arch_flags = M_NS32532; break;
+       case 0:         arch_flags = M_NS32532; break;
        case 32032:     arch_flags = M_NS32032; break;
        case 32532:     arch_flags = M_NS32532; break;
        default:        arch_flags = M_UNKNOWN; break;
@@ -930,8 +946,8 @@ adjust_o_magic (bfd *abfd, struct internal_exec *execp)
   else
     {
       /* The VMA of the .bss section is set by the VMA of the
-         .data section plus the size of the .data section.  We may
-         need to add padding bytes to make this true.  */
+        .data section plus the size of the .data section.  We may
+        need to add padding bytes to make this true.  */
       pad = obj_bsssec (abfd)->vma - vma;
       if (pad > 0)
        {
@@ -945,7 +961,7 @@ adjust_o_magic (bfd *abfd, struct internal_exec *execp)
   execp->a_text = obj_textsec (abfd)->size;
   execp->a_data = obj_datasec (abfd)->size;
   execp->a_bss = obj_bsssec (abfd)->size;
-  N_SET_MAGIC (*execp, OMAGIC);
+  N_SET_MAGIC (execp, OMAGIC);
 }
 
 static void
@@ -980,8 +996,8 @@ adjust_z_magic (bfd *abfd, struct internal_exec *execp)
   else
     {
       /* The .text section is being loaded at an unusual address.  We
-         may need to pad it such that the .data section starts at a page
-         boundary.  */
+        may need to pad it such that the .data section starts at a page
+        boundary.  */
       if (ztih)
        text_pad = ((obj_textsec (abfd)->filepos - obj_textsec (abfd)->vma)
                    & (adata (abfd).page_size - 1));
@@ -1034,9 +1050,9 @@ adjust_z_magic (bfd *abfd, struct internal_exec *execp)
   if (ztih && (!abdp || (abdp && !abdp->exec_header_not_counted)))
     execp->a_text += adata (abfd).exec_bytes_size;
   if (obj_aout_subformat (abfd) == q_magic_format)
-    N_SET_MAGIC (*execp, QMAGIC);
+    N_SET_MAGIC (execp, QMAGIC);
   else
-    N_SET_MAGIC (*execp, ZMAGIC);
+    N_SET_MAGIC (execp, ZMAGIC);
 
   /* Spec says data section should be rounded up to page boundary.  */
   obj_datasec (abfd)->size
@@ -1103,13 +1119,11 @@ adjust_n_magic (bfd *abfd, struct internal_exec *execp)
   execp->a_text = obj_textsec (abfd)->size;
   execp->a_data = obj_datasec (abfd)->size;
   execp->a_bss = obj_bsssec (abfd)->size;
-  N_SET_MAGIC (*execp, NMAGIC);
+  N_SET_MAGIC (execp, NMAGIC);
 }
 
 bfd_boolean
-NAME (aout, adjust_sizes_and_vmas) (bfd *abfd,
-                                   bfd_size_type *text_size,
-                                   file_ptr *text_end ATTRIBUTE_UNUSED)
+NAME (aout, adjust_sizes_and_vmas) (bfd *abfd)
 {
   struct internal_exec *execp = exec_hdr (abfd);
 
@@ -1123,7 +1137,6 @@ NAME (aout, adjust_sizes_and_vmas) (bfd *abfd,
     align_power (obj_textsec (abfd)->size,
                 obj_textsec (abfd)->alignment_power);
 
-  *text_size = obj_textsec (abfd)->size;
   /* Rule (heuristic) for when to pad to a new page.  Note that there
      are (at least) two ways demand-paged (ZMAGIC) files have been
      handled.  Most Berkeley-based systems start the text segment at
@@ -1162,11 +1175,11 @@ NAME (aout, adjust_sizes_and_vmas) (bfd *abfd,
              str;
            }),
           obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
-               obj_textsec (abfd)->alignment_power,
+               obj_textsec (abfd)->alignment_power,
           obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
-               obj_datasec (abfd)->alignment_power,
+               obj_datasec (abfd)->alignment_power,
           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size,
-               obj_bsssec (abfd)->alignment_power);
+               obj_bsssec (abfd)->alignment_power);
 #endif
 #endif
 
@@ -1188,9 +1201,9 @@ NAME (aout, adjust_sizes_and_vmas) (bfd *abfd,
 #ifdef BFD_AOUT_DEBUG
   fprintf (stderr, "       text=<%x,%x,%x> data=<%x,%x,%x> bss=<%x,%x>\n",
           obj_textsec (abfd)->vma, obj_textsec (abfd)->size,
-               obj_textsec (abfd)->filepos,
+               obj_textsec (abfd)->filepos,
           obj_datasec (abfd)->vma, obj_datasec (abfd)->size,
-               obj_datasec (abfd)->filepos,
+               obj_datasec (abfd)->filepos,
           obj_bsssec (abfd)->vma, obj_bsssec (abfd)->size);
 #endif
 
@@ -1202,7 +1215,7 @@ FUNCTION
        aout_@var{size}_new_section_hook
 
 SYNOPSIS
-        bfd_boolean aout_@var{size}_new_section_hook,
+       bfd_boolean aout_@var{size}_new_section_hook,
           (bfd *abfd,
            asection *newsect);
 
@@ -1246,12 +1259,9 @@ NAME (aout, set_section_contents) (bfd *abfd,
                                   file_ptr offset,
                                   bfd_size_type count)
 {
-  file_ptr text_end;
-  bfd_size_type text_size;
-
   if (! abfd->output_has_begun)
     {
-      if (! NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end))
+      if (! NAME (aout, adjust_sizes_and_vmas) (abfd))
        return FALSE;
     }
 
@@ -1269,11 +1279,12 @@ NAME (aout, set_section_contents) (bfd *abfd,
                           (section->vma - obj_textsec (abfd)->vma);
       else
        {
-          (*_bfd_error_handler)
-          (_("%s: can not represent section `%s' in a.out object file format"),
-            bfd_get_filename (abfd), bfd_get_section_name (abfd, section));
-          bfd_set_error (bfd_error_nonrepresentable_section);
-          return FALSE;
+         _bfd_error_handler
+           /* xgettext:c-format */
+          (_("%B: can not represent section `%A' in a.out object file format"),
+            abfd, section);
+         bfd_set_error (bfd_error_nonrepresentable_section);
+         return FALSE;
        }
     }
 
@@ -1296,14 +1307,14 @@ aout_get_external_symbols (bfd *abfd)
     {
       bfd_size_type count;
       struct external_nlist *syms;
+      bfd_size_type amt = exec_hdr (abfd)->a_syms;
 
-      count = exec_hdr (abfd)->a_syms / EXTERNAL_NLIST_SIZE;
+      count = amt / EXTERNAL_NLIST_SIZE;
       if (count == 0)
        return TRUE;            /* Nothing to do.  */
 
 #ifdef USE_MMAP
-      if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd),
-                                exec_hdr (abfd)->a_syms,
+      if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), amt,
                                 &obj_aout_sym_window (abfd), TRUE))
        return FALSE;
       syms = (struct external_nlist *) obj_aout_sym_window (abfd).data;
@@ -1311,20 +1322,16 @@ aout_get_external_symbols (bfd *abfd)
       /* We allocate using malloc to make the values easy to free
         later on.  If we put them on the objalloc it might not be
         possible to free them.  */
-      syms = (struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE);
+      syms = (struct external_nlist *) bfd_malloc (amt);
       if (syms == NULL)
        return FALSE;
 
-      {
-       bfd_size_type amt;
-       amt = exec_hdr (abfd)->a_syms;
-       if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
-           || bfd_bread (syms, amt, abfd) != amt)
-         {
-           free (syms);
-           return FALSE;
-         }
-      }
+      if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0
+         || bfd_bread (syms, amt, abfd) != amt)
+       {
+         free (syms);
+         return FALSE;
+       }
 #endif
 
       obj_aout_external_syms (abfd) = syms;
@@ -1344,27 +1351,42 @@ aout_get_external_symbols (bfd *abfd)
          || bfd_bread ((void *) string_chars, amt, abfd) != amt)
        return FALSE;
       stringsize = GET_WORD (abfd, string_chars);
+      if (stringsize == 0)
+       stringsize = 1;
+      else if (stringsize < BYTES_IN_WORD
+              || (size_t) stringsize != stringsize)
+       {
+         bfd_set_error (bfd_error_bad_value);
+         return FALSE;
+       }
 
 #ifdef USE_MMAP
-      if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
-                                &obj_aout_string_window (abfd), TRUE))
-       return FALSE;
-      strings = (char *) obj_aout_string_window (abfd).data;
-#else
-      strings = (char *) bfd_malloc (stringsize + 1);
-      if (strings == NULL)
-       return FALSE;
-
-      /* Skip space for the string count in the buffer for convenience
-        when using indexes.  */
-      amt = stringsize - BYTES_IN_WORD;
-      if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt)
+      if (stringsize >= BYTES_IN_WORD)
        {
-         free (strings);
-         return FALSE;
+         if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize,
+                                    &obj_aout_string_window (abfd), TRUE))
+           return FALSE;
+         strings = (char *) obj_aout_string_window (abfd).data;
        }
+      else
 #endif
+       {
+         strings = (char *) bfd_malloc (stringsize);
+         if (strings == NULL)
+           return FALSE;
 
+         if (stringsize >= BYTES_IN_WORD)
+           {
+             /* Keep the string count in the buffer for convenience
+                when indexing with e_strx.  */
+             amt = stringsize - BYTES_IN_WORD;
+             if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt)
+               {
+                 free (strings);
+                 return FALSE;
+               }
+           }
+       }
       /* Ensure that a zero index yields an empty string.  */
       strings[0] = '\0';
 
@@ -1480,8 +1502,8 @@ translate_from_native_sym_flags (bfd *abfd, aout_symbol_type *cache_ptr)
     case N_SETB: case N_SETB | N_EXT:
       {
        /* 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.  */
+          the linker handle set symbols, but they are now handled in
+          the add_symbols routine instead.  */
        switch (cache_ptr->type & N_TYPE)
          {
          case N_SETA:
@@ -1573,9 +1595,11 @@ translate_to_native_sym_flags (bfd *abfd,
     {
       /* This case occurs, e.g., for the *DEBUG* section of a COFF
         file.  */
-      (*_bfd_error_handler)
-       (_("%s: can not represent section for symbol `%s' in a.out object file format"),
-        bfd_get_filename (abfd),
+      _bfd_error_handler
+       /* xgettext:c-format */
+       (_("%B: can not represent section for symbol `%s' in a.out "
+          "object file format"),
+        abfd,
         cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*"));
       bfd_set_error (bfd_error_nonrepresentable_section);
       return FALSE;
@@ -1607,11 +1631,12 @@ translate_to_native_sym_flags (bfd *abfd,
        sym_pointer->e_type[0] |= N_TEXT;
       else
        {
-          (*_bfd_error_handler)
-          (_("%s: can not represent section `%s' in a.out object file format"),
-            bfd_get_filename (abfd), bfd_get_section_name (abfd, sec));
-          bfd_set_error (bfd_error_nonrepresentable_section);
-          return FALSE;
+         _bfd_error_handler
+           /* xgettext:c-format */
+          (_("%B: can not represent section `%A' in a.out object file format"),
+            abfd, sec);
+         bfd_set_error (bfd_error_nonrepresentable_section);
+         return FALSE;
        }
     }
 
@@ -1947,6 +1972,7 @@ NAME (aout, swap_std_reloc_out) (bfd *abfd,
 
   PUT_WORD (abfd, g->address, natptr->r_address);
 
+  BFD_ASSERT (g->howto != NULL);
   r_length = g->howto->size ;  /* Size as a power of two.  */
   r_pcrel  = (int) g->howto->pc_relative; /* Relative to PC?  */
   /* XXX This relies on relocs coming from a.out files.  */
@@ -2187,7 +2213,7 @@ NAME (aout, swap_ext_reloc_in) (bfd *abfd,
   if (r_extern && r_index > symcount)
     {
       /* We could arrange to return an error, but it might be useful
-         to see the file even if it is bad.  */
+        to see the file even if it is bad.  */
       r_extern = 0;
       r_index = N_ABS;
     }
@@ -2260,7 +2286,7 @@ NAME (aout, swap_std_reloc_in) (bfd *abfd,
   if (r_extern && r_index > symcount)
     {
       /* We could arrange to return an error, but it might be useful
-         to see the file even if it is bad.  */
+        to see the file even if it is bad.  */
       r_extern = 0;
       r_index = N_ABS;
     }
@@ -2385,16 +2411,39 @@ NAME (aout, squirt_out_relocs) (bfd *abfd, asection *section)
       for (natptr = native;
           count != 0;
           --count, natptr += each_size, ++generic)
-       MY_swap_ext_reloc_out (abfd, *generic,
-                              (struct reloc_ext_external *) natptr);
+       {
+         /* PR 20921: If the howto field has not been initialised then skip
+            this reloc.
+            PR 20929: Similarly for the symbol field.  */
+         if ((*generic)->howto == NULL
+             || (*generic)->sym_ptr_ptr == NULL)
+           {
+             bfd_set_error (bfd_error_invalid_operation);
+             _bfd_error_handler (_("\
+%B: attempt to write out unknown reloc type"), abfd);
+             return FALSE;
+           }
+         MY_swap_ext_reloc_out (abfd, *generic,
+                                (struct reloc_ext_external *) natptr);
+       }
     }
   else
     {
       for (natptr = native;
           count != 0;
           --count, natptr += each_size, ++generic)
-       MY_swap_std_reloc_out (abfd, *generic,
-                              (struct reloc_std_external *) natptr);
+       {
+         if ((*generic)->howto == NULL
+             || (*generic)->sym_ptr_ptr == NULL)
+           {
+             bfd_set_error (bfd_error_invalid_operation);
+             _bfd_error_handler (_("\
+%B: attempt to write out unknown reloc type"), abfd);
+             return FALSE;
+           }
+         MY_swap_std_reloc_out (abfd, *generic,
+                                (struct reloc_std_external *) natptr);
+       }
     }
 
   if (bfd_bwrite ((void *) native, natsize, abfd) != natsize)
@@ -2636,12 +2685,13 @@ NAME (aout, minisymbol_to_symbol) (bfd *abfd,
 
 bfd_boolean
 NAME (aout, find_nearest_line) (bfd *abfd,
-                               asection *section,
                                asymbol **symbols,
+                               asection *section,
                                bfd_vma offset,
                                const char **filename_ptr,
                                const char **functionname_ptr,
-                               unsigned int *line_ptr)
+                               unsigned int *line_ptr,
+                               unsigned int *disriminator_ptr)
 {
   /* Run down the file looking for the filename, function and linenumber.  */
   asymbol **p;
@@ -2657,8 +2707,10 @@ NAME (aout, find_nearest_line) (bfd *abfd,
   char *buf;
 
   *filename_ptr = abfd->filename;
-  *functionname_ptr = 0;
+  *functionname_ptr = NULL;
   *line_ptr = 0;
+  if (disriminator_ptr)
+    *disriminator_ptr = 0;
 
   if (symbols != NULL)
     {
@@ -2800,9 +2852,17 @@ NAME (aout, find_nearest_line) (bfd *abfd,
        *filename_ptr = main_file_name;
       else
        {
-         sprintf (buf, "%s%s", directory_name, main_file_name);
-         *filename_ptr = buf;
-         buf += filelen + 1;
+         if (buf == NULL)
+           /* PR binutils/20891: In a corrupt input file both
+              main_file_name and directory_name can be empty...  */
+           * filename_ptr = NULL;
+         else
+           {
+             snprintf (buf, filelen + 1, "%s%s", directory_name,
+                       main_file_name);
+             *filename_ptr = buf;
+             buf += filelen + 1;
+           }
        }
     }
 
@@ -2811,6 +2871,12 @@ NAME (aout, find_nearest_line) (bfd *abfd,
       const char *function = func->name;
       char *colon;
 
+      if (buf == NULL)
+       {
+         /* PR binutils/20892: In a corrupt input file func can be empty.  */
+         * functionname_ptr = NULL;
+         return TRUE;
+       }
       /* The caller expects a symbol name.  We actually have a
         function name, without the leading underscore.  Put the
         underscore back in, so that the caller gets a symbol name.  */
@@ -2883,7 +2949,7 @@ NAME (aout, link_hash_newfunc) (struct bfd_hash_entry *entry,
      subclass.  */
   if (ret == NULL)
     ret = (struct aout_link_hash_entry *) bfd_hash_allocate (table,
-                                                             sizeof (* ret));
+                                                            sizeof (* ret));
   if (ret == NULL)
     return NULL;
 
@@ -3005,6 +3071,9 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
       if ((type & N_STAB) != 0)
        continue;
 
+      /* PR 19629: Corrupt binaries can contain illegal string offsets.  */
+      if (GET_WORD (abfd, p->e_strx) >= obj_aout_external_string_size (abfd))
+       return FALSE;
       name = strings + GET_WORD (abfd, p->e_strx);
       value = GET_WORD (abfd, p->e_value);
       flags = BSF_GLOBAL;
@@ -3061,8 +3130,13 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
        case N_INDR | N_EXT:
          /* An indirect symbol.  The next symbol is the symbol
             which this one really is.  */
-         BFD_ASSERT (p + 1 < pend);
+         /* See PR 20925 for a reproducer.  */
+         if (p + 1 >= pend)
+           return FALSE;
          ++p;
+         /* PR 19629: Corrupt binaries can contain illegal string offsets.  */
+         if (GET_WORD (abfd, p->e_strx) >= obj_aout_external_string_size (abfd))
+           return FALSE;
          string = strings + GET_WORD (abfd, p->e_strx);
          section = bfd_ind_section_ptr;
          flags |= BSF_INDIRECT;
@@ -3096,6 +3170,9 @@ aout_link_add_symbols (bfd *abfd, struct bfd_link_info *info)
            return TRUE;
          ++p;
          string = name;
+         /* PR 19629: Corrupt binaries can contain illegal string offsets.  */
+         if (GET_WORD (abfd, p->e_strx) >= obj_aout_external_string_size (abfd))
+           return FALSE;
          name = strings + GET_WORD (abfd, p->e_strx);
          section = bfd_und_section_ptr;
          flags |= BSF_WARNING;
@@ -3270,13 +3347,13 @@ aout_link_check_ar_symbols (bfd *abfd,
             in.  This is true regardless of whether the current
             definition of the symbol is undefined or common.
 
-             If the current definition is common, we have a case in
+            If the current definition is common, we have a case in
             which we have already seen an object file including:
-                int a;
+                int a;
             and this object file from the archive includes:
-                int a = 5;
+                int a = 5;
             In such a case, whether to include this object is target
-             dependant for backward compatibility.
+            dependant for backward compatibility.
 
             FIXME: The SunOS 4.1.3 linker will pull in the archive
             element if the symbol is defined in the .data section,
@@ -3402,6 +3479,8 @@ aout_link_check_ar_symbols (bfd *abfd,
 static bfd_boolean
 aout_link_check_archive_element (bfd *abfd,
                                 struct bfd_link_info *info,
+                                struct bfd_link_hash_entry *h ATTRIBUTE_UNUSED,
+                                const char *name ATTRIBUTE_UNUSED,
                                 bfd_boolean *pneeded)
 {
   bfd *oldbfd;
@@ -3531,7 +3610,7 @@ aout_link_includes_newfunc (struct bfd_hash_entry *entry,
      subclass.  */
   if (ret == NULL)
     ret = (struct aout_link_includes_entry *)
-        bfd_hash_allocate (table, sizeof (* ret));
+       bfd_hash_allocate (table, sizeof (* ret));
   if (ret == NULL)
     return NULL;
 
@@ -3554,7 +3633,7 @@ static bfd_boolean
 aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
 {
   struct aout_link_hash_entry *h = (struct aout_link_hash_entry *) bh;
-  struct aout_final_link_info *finfo = (struct aout_final_link_info *) data;
+  struct aout_final_link_info *flaginfo = (struct aout_final_link_info *) data;
   bfd *output_bfd;
   int type;
   bfd_vma val;
@@ -3569,12 +3648,12 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
        return TRUE;
     }
 
-  output_bfd = finfo->output_bfd;
+  output_bfd = flaginfo->output_bfd;
 
   if (aout_backend_info (output_bfd)->write_dynamic_symbol != NULL)
     {
       if (! ((*aout_backend_info (output_bfd)->write_dynamic_symbol)
-            (output_bfd, finfo->info, h)))
+            (output_bfd, flaginfo->info, h)))
        {
          /* FIXME: No way to handle errors.  */
          abort ();
@@ -3588,9 +3667,9 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
 
   /* An indx of -2 means the symbol must be written.  */
   if (h->indx != -2
-      && (finfo->info->strip == strip_all
-         || (finfo->info->strip == strip_some
-             && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string,
+      && (flaginfo->info->strip == strip_all
+         || (flaginfo->info->strip == strip_some
+             && bfd_hash_lookup (flaginfo->info->keep_hash, h->root.root.string,
                                  FALSE, FALSE) == NULL)))
     return TRUE;
 
@@ -3603,7 +3682,7 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
       return TRUE;
     case bfd_link_hash_new:
       /* This can happen for set symbols when sets are not being
-         built.  */
+        built.  */
       return TRUE;
     case bfd_link_hash_undefined:
       type = N_UNDF | N_EXT;
@@ -3648,7 +3727,7 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
   H_PUT_8 (output_bfd, type, outsym.e_type);
   H_PUT_8 (output_bfd, 0, outsym.e_other);
   H_PUT_16 (output_bfd, 0, outsym.e_desc);
-  indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string,
+  indx = add_to_stringtab (output_bfd, flaginfo->strtab, h->root.root.string,
                           FALSE);
   if (indx == - (bfd_size_type) 1)
     /* FIXME: No way to handle errors.  */
@@ -3658,12 +3737,12 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
   PUT_WORD (output_bfd, val, outsym.e_value);
 
   amt = EXTERNAL_NLIST_SIZE;
-  if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0
+  if (bfd_seek (output_bfd, flaginfo->symoff, SEEK_SET) != 0
       || bfd_bwrite ((void *) &outsym, amt, output_bfd) != amt)
     /* FIXME: No way to handle errors.  */
     abort ();
 
-  finfo->symoff += EXTERNAL_NLIST_SIZE;
+  flaginfo->symoff += EXTERNAL_NLIST_SIZE;
   h->indx = obj_aout_external_sym_count (output_bfd);
   ++obj_aout_external_sym_count (output_bfd);
 
@@ -3673,7 +3752,7 @@ aout_link_write_other_symbol (struct bfd_hash_entry *bh, void *data)
 /* Handle a link order which is supposed to generate a reloc.  */
 
 static bfd_boolean
-aout_link_reloc_link_order (struct aout_final_link_info *finfo,
+aout_link_reloc_link_order (struct aout_final_link_info *flaginfo,
                            asection *o,
                            struct bfd_link_order *p)
 {
@@ -3696,7 +3775,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
        r_index = N_ABS | N_EXT;
       else
        {
-         BFD_ASSERT (pr->u.section->owner == finfo->output_bfd);
+         BFD_ASSERT (pr->u.section->owner == flaginfo->output_bfd);
          r_index = pr->u.section->target_index;
        }
     }
@@ -3707,7 +3786,7 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
       BFD_ASSERT (p->type == bfd_symbol_reloc_link_order);
       r_extern = 1;
       h = ((struct aout_link_hash_entry *)
-          bfd_wrapped_link_hash_lookup (finfo->output_bfd, finfo->info,
+          bfd_wrapped_link_hash_lookup (flaginfo->output_bfd, flaginfo->info,
                                         pr->u.name, FALSE, FALSE, TRUE));
       if (h != NULL
          && h->indx >= 0)
@@ -3720,37 +3799,36 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
             symbol.  */
          h->indx = -2;
          h->written = FALSE;
-         if (!aout_link_write_other_symbol (&h->root.root, finfo))
+         if (!aout_link_write_other_symbol (&h->root.root, flaginfo))
            return FALSE;
          r_index = h->indx;
        }
       else
        {
-         if (! ((*finfo->info->callbacks->unattached_reloc)
-                (finfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0)))
-           return FALSE;
+         (*flaginfo->info->callbacks->unattached_reloc)
+           (flaginfo->info, pr->u.name, NULL, NULL, (bfd_vma) 0);
          r_index = 0;
        }
     }
 
-  howto = bfd_reloc_type_lookup (finfo->output_bfd, pr->reloc);
+  howto = bfd_reloc_type_lookup (flaginfo->output_bfd, pr->reloc);
   if (howto == 0)
     {
       bfd_set_error (bfd_error_bad_value);
       return FALSE;
     }
 
-  if (o == obj_textsec (finfo->output_bfd))
-    reloff_ptr = &finfo->treloff;
-  else if (o == obj_datasec (finfo->output_bfd))
-    reloff_ptr = &finfo->dreloff;
+  if (o == obj_textsec (flaginfo->output_bfd))
+    reloff_ptr = &flaginfo->treloff;
+  else if (o == obj_datasec (flaginfo->output_bfd))
+    reloff_ptr = &flaginfo->dreloff;
   else
     abort ();
 
-  if (obj_reloc_entry_size (finfo->output_bfd) == RELOC_STD_SIZE)
+  if (obj_reloc_entry_size (flaginfo->output_bfd) == RELOC_STD_SIZE)
     {
 #ifdef MY_put_reloc
-      MY_put_reloc (finfo->output_bfd, r_extern, r_index, p->offset, howto,
+      MY_put_reloc (flaginfo->output_bfd, r_extern, r_index, p->offset, howto,
                    &srel);
 #else
       {
@@ -3766,8 +3844,8 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
        r_relative = (howto->type & 32) != 0;
        r_length = howto->size;
 
-       PUT_WORD (finfo->output_bfd, p->offset, srel.r_address);
-       if (bfd_header_big_endian (finfo->output_bfd))
+       PUT_WORD (flaginfo->output_bfd, p->offset, srel.r_address);
+       if (bfd_header_big_endian (flaginfo->output_bfd))
          {
            srel.r_index[0] = r_index >> 16;
            srel.r_index[1] = r_index >> 8;
@@ -3811,9 +3889,9 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
 
          size = bfd_get_reloc_size (howto);
          buf = (bfd_byte *) bfd_zmalloc (size);
-         if (buf == NULL)
+         if (buf == NULL && size != 0)
            return FALSE;
-         r = MY_relocate_contents (howto, finfo->output_bfd,
+         r = MY_relocate_contents (howto, flaginfo->output_bfd,
                                    (bfd_vma) pr->addend, buf);
          switch (r)
            {
@@ -3823,20 +3901,16 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
            case bfd_reloc_outofrange:
              abort ();
            case bfd_reloc_overflow:
-             if (! ((*finfo->info->callbacks->reloc_overflow)
-                    (finfo->info, NULL,
-                     (p->type == bfd_section_reloc_link_order
-                      ? bfd_section_name (finfo->output_bfd,
-                                          pr->u.section)
-                      : pr->u.name),
-                     howto->name, pr->addend, NULL, NULL, (bfd_vma) 0)))
-               {
-                 free (buf);
-                 return FALSE;
-               }
+             (*flaginfo->info->callbacks->reloc_overflow)
+               (flaginfo->info, NULL,
+                (p->type == bfd_section_reloc_link_order
+                 ? bfd_section_name (flaginfo->output_bfd,
+                                     pr->u.section)
+                 : pr->u.name),
+                howto->name, pr->addend, NULL, NULL, (bfd_vma) 0);
              break;
            }
-         ok = bfd_set_section_contents (finfo->output_bfd, o, (void *) buf,
+         ok = bfd_set_section_contents (flaginfo->output_bfd, o, (void *) buf,
                                         (file_ptr) p->offset, size);
          free (buf);
          if (! ok)
@@ -3846,12 +3920,12 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
   else
     {
 #ifdef MY_put_ext_reloc
-      MY_put_ext_reloc (finfo->output_bfd, r_extern, r_index, p->offset,
+      MY_put_ext_reloc (flaginfo->output_bfd, r_extern, r_index, p->offset,
                        howto, &erel, pr->addend);
 #else
-      PUT_WORD (finfo->output_bfd, p->offset, erel.r_address);
+      PUT_WORD (flaginfo->output_bfd, p->offset, erel.r_address);
 
-      if (bfd_header_big_endian (finfo->output_bfd))
+      if (bfd_header_big_endian (flaginfo->output_bfd))
        {
          erel.r_index[0] = r_index >> 16;
          erel.r_index[1] = r_index >> 8;
@@ -3870,25 +3944,25 @@ aout_link_reloc_link_order (struct aout_final_link_info *finfo,
              | (howto->type << RELOC_EXT_BITS_TYPE_SH_LITTLE);
        }
 
-      PUT_WORD (finfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
+      PUT_WORD (flaginfo->output_bfd, (bfd_vma) pr->addend, erel.r_addend);
 #endif /* MY_put_ext_reloc */
 
       rel_ptr = (void *) &erel;
     }
 
-  amt = obj_reloc_entry_size (finfo->output_bfd);
-  if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0
-      || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt)
+  amt = obj_reloc_entry_size (flaginfo->output_bfd);
+  if (bfd_seek (flaginfo->output_bfd, *reloff_ptr, SEEK_SET) != 0
+      || bfd_bwrite (rel_ptr, amt, flaginfo->output_bfd) != amt)
     return FALSE;
 
-  *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd);
+  *reloff_ptr += obj_reloc_entry_size (flaginfo->output_bfd);
 
   /* Assert that the relocs have not run into the symbols, and that n
      the text relocs have not run into the data relocs.  */
-  BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (finfo->output_bfd)
-             && (reloff_ptr != &finfo->treloff
+  BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (flaginfo->output_bfd)
+             && (reloff_ptr != &flaginfo->treloff
                  || (*reloff_ptr
-                     <= obj_datasec (finfo->output_bfd)->rel_filepos)));
+                     <= obj_datasec (flaginfo->output_bfd)->rel_filepos)));
 
   return TRUE;
 }
@@ -3913,7 +3987,7 @@ aout_reloc_index_to_section (bfd *abfd, int indx)
 /* Relocate an a.out section using standard a.out relocs.  */
 
 static bfd_boolean
-aout_link_input_section_std (struct aout_final_link_info *finfo,
+aout_link_input_section_std (struct aout_final_link_info *flaginfo,
                             bfd *input_bfd,
                             asection *input_section,
                             struct reloc_std_external *relocs,
@@ -3934,18 +4008,18 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
   struct reloc_std_external *rel;
   struct reloc_std_external *rel_end;
 
-  output_bfd = finfo->output_bfd;
+  output_bfd = flaginfo->output_bfd;
   check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
 
   BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE);
   BFD_ASSERT (input_bfd->xvec->header_byteorder
              == output_bfd->xvec->header_byteorder);
 
-  relocatable = finfo->info->relocatable;
+  relocatable = bfd_link_relocatable (flaginfo->info);
   syms = obj_aout_external_syms (input_bfd);
   strings = obj_aout_external_strings (input_bfd);
   sym_hashes = obj_aout_sym_hashes (input_bfd);
-  symbol_map = finfo->symbol_map;
+  symbol_map = flaginfo->symbol_map;
 
   reloc_count = rel_size / RELOC_STD_SIZE;
   rel = relocs;
@@ -4014,7 +4088,7 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
 
       if (howto == NULL)
        {
-         (*finfo->info->callbacks->einfo)
+         (*flaginfo->info->callbacks->einfo)
            (_("%P: %B: unexpected relocation type\n"), input_bfd);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
@@ -4070,16 +4144,16 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
                      if (h != NULL)
                        {
                          /* We decided to strip this symbol, but it
-                             turns out that we can't.  Note that we
-                             lose the other and desc information here.
-                             I don't think that will ever matter for a
-                             global symbol.  */
+                            turns out that we can't.  Note that we
+                            lose the other and desc information here.
+                            I don't think that will ever matter for a
+                            global symbol.  */
                          if (h->indx < 0)
                            {
                              h->indx = -2;
                              h->written = FALSE;
                              if (!aout_link_write_other_symbol (&h->root.root,
-                                                                finfo))
+                                                                flaginfo))
                                return FALSE;
                            }
                          r_index = h->indx;
@@ -4090,10 +4164,9 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
 
                          name = strings + GET_WORD (input_bfd,
                                                     syms[r_index].e_strx);
-                         if (! ((*finfo->info->callbacks->unattached_reloc)
-                                (finfo->info, name, input_bfd, input_section,
-                                 r_addr)))
-                           return FALSE;
+                         (*flaginfo->info->callbacks->unattached_reloc)
+                           (flaginfo->info, name,
+                            input_bfd, input_section, r_addr);
                          r_index = 0;
                        }
                    }
@@ -4197,7 +4270,7 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
              bfd_boolean skip;
 
              if (! ((*check_dynamic_reloc)
-                    (finfo->info, input_bfd, input_section, h,
+                    (flaginfo->info, input_bfd, input_section, h,
                      (void *) rel, contents, &skip, &relocation)))
                return FALSE;
              if (skip)
@@ -4205,9 +4278,9 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
            }
 
          /* Now warn if a global symbol is undefined.  We could not
-             do this earlier, because check_dynamic_reloc might want
-             to skip this reloc.  */
-         if (hundef && ! finfo->info->shared && ! r_baserel)
+            do this earlier, because check_dynamic_reloc might want
+            to skip this reloc.  */
+         if (hundef && ! bfd_link_pic (flaginfo->info) && ! r_baserel)
            {
              const char *name;
 
@@ -4215,10 +4288,8 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
                name = h->root.root.string;
              else
                name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
-             if (! ((*finfo->info->callbacks->undefined_symbol)
-                    (finfo->info, name, input_bfd, input_section,
-                    r_addr, TRUE)))
-               return FALSE;
+             (*flaginfo->info->callbacks->undefined_symbol)
+               (flaginfo->info, name, input_bfd, input_section, r_addr, TRUE);
            }
 
          r = MY_final_link_relocate (howto,
@@ -4250,11 +4321,9 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
                    s = aout_reloc_index_to_section (input_bfd, r_index);
                    name = bfd_section_name (input_bfd, s);
                  }
-               if (! ((*finfo->info->callbacks->reloc_overflow)
-                      (finfo->info, (h ? &h->root : NULL), name,
-                       howto->name, (bfd_vma) 0, input_bfd,
-                       input_section, r_addr)))
-                 return FALSE;
+               (*flaginfo->info->callbacks->reloc_overflow)
+                 (flaginfo->info, (h ? &h->root : NULL), name, howto->name,
+                  (bfd_vma) 0, input_bfd, input_section, r_addr);
              }
              break;
            }
@@ -4267,7 +4336,7 @@ aout_link_input_section_std (struct aout_final_link_info *finfo,
 /* Relocate an a.out section using extended a.out relocs.  */
 
 static bfd_boolean
-aout_link_input_section_ext (struct aout_final_link_info *finfo,
+aout_link_input_section_ext (struct aout_final_link_info *flaginfo,
                             bfd *input_bfd,
                             asection *input_section,
                             struct reloc_ext_external *relocs,
@@ -4288,18 +4357,18 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
   struct reloc_ext_external *rel;
   struct reloc_ext_external *rel_end;
 
-  output_bfd = finfo->output_bfd;
+  output_bfd = flaginfo->output_bfd;
   check_dynamic_reloc = aout_backend_info (output_bfd)->check_dynamic_reloc;
 
   BFD_ASSERT (obj_reloc_entry_size (input_bfd) == RELOC_EXT_SIZE);
   BFD_ASSERT (input_bfd->xvec->header_byteorder
              == output_bfd->xvec->header_byteorder);
 
-  relocatable = finfo->info->relocatable;
+  relocatable = bfd_link_relocatable (flaginfo->info);
   syms = obj_aout_external_syms (input_bfd);
   strings = obj_aout_external_strings (input_bfd);
   sym_hashes = obj_aout_sym_hashes (input_bfd);
-  symbol_map = finfo->symbol_map;
+  symbol_map = flaginfo->symbol_map;
 
   reloc_count = rel_size / RELOC_EXT_SIZE;
   rel = relocs;
@@ -4340,7 +4409,7 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
 
       if (r_type >= TABLE_SIZE (howto_table_ext))
        {
-         (*finfo->info->callbacks->einfo)
+         (*flaginfo->info->callbacks->einfo)
            (_("%P: %B: unexpected relocation type\n"), input_bfd);
          bfd_set_error (bfd_error_bad_value);
          return FALSE;
@@ -4412,16 +4481,16 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
                      if (h != NULL)
                        {
                          /* We decided to strip this symbol, but it
-                             turns out that we can't.  Note that we
-                             lose the other and desc information here.
-                             I don't think that will ever matter for a
-                             global symbol.  */
+                            turns out that we can't.  Note that we
+                            lose the other and desc information here.
+                            I don't think that will ever matter for a
+                            global symbol.  */
                          if (h->indx < 0)
                            {
                              h->indx = -2;
                              h->written = FALSE;
                              if (!aout_link_write_other_symbol (&h->root.root,
-                                                                finfo))
+                                                                flaginfo))
                                return FALSE;
                            }
                          r_index = h->indx;
@@ -4432,10 +4501,9 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
 
                          name = strings + GET_WORD (input_bfd,
                                                     syms[r_index].e_strx);
-                         if (! ((*finfo->info->callbacks->unattached_reloc)
-                                (finfo->info, name, input_bfd, input_section,
-                                 r_addr)))
-                           return FALSE;
+                         (*flaginfo->info->callbacks->unattached_reloc)
+                           (flaginfo->info, name,
+                            input_bfd, input_section, r_addr);
                          r_index = 0;
                        }
                    }
@@ -4536,7 +4604,7 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
              int type;
 
              /* For base relative relocs, r_index is always an index
-                 into the symbol table, even if r_extern is 0.  */
+                into the symbol table, even if r_extern is 0.  */
              sym = syms + r_index;
              type = H_GET_8 (input_bfd, sym->e_type);
              if ((type & N_TYPE) == N_TEXT
@@ -4600,7 +4668,7 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
              bfd_boolean skip;
 
              if (! ((*check_dynamic_reloc)
-                    (finfo->info, input_bfd, input_section, h,
+                    (flaginfo->info, input_bfd, input_section, h,
                      (void *) rel, contents, &skip, &relocation)))
                return FALSE;
              if (skip)
@@ -4608,10 +4676,10 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
            }
 
          /* Now warn if a global symbol is undefined.  We could not
-             do this earlier, because check_dynamic_reloc might want
-             to skip this reloc.  */
+            do this earlier, because check_dynamic_reloc might want
+            to skip this reloc.  */
          if (hundef
-             && ! finfo->info->shared
+             && ! bfd_link_pic (flaginfo->info)
              && r_type != (unsigned int) RELOC_BASE10
              && r_type != (unsigned int) RELOC_BASE13
              && r_type != (unsigned int) RELOC_BASE22)
@@ -4622,10 +4690,8 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
                name = h->root.root.string;
              else
                name = strings + GET_WORD (input_bfd, syms[r_index].e_strx);
-             if (! ((*finfo->info->callbacks->undefined_symbol)
-                    (finfo->info, name, input_bfd, input_section,
-                    r_addr, TRUE)))
-               return FALSE;
+             (*flaginfo->info->callbacks->undefined_symbol)
+               (flaginfo->info, name, input_bfd, input_section, r_addr, TRUE);
            }
 
          if (r_type != (unsigned int) RELOC_SPARC_REV32)
@@ -4669,11 +4735,10 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
                        s = aout_reloc_index_to_section (input_bfd, r_index);
                        name = bfd_section_name (input_bfd, s);
                      }
-                   if (! ((*finfo->info->callbacks->reloc_overflow)
-                          (finfo->info, (h ? &h->root : NULL), name,
-                           howto_table_ext[r_type].name,
-                           r_addend, input_bfd, input_section, r_addr)))
-                     return FALSE;
+                   (*flaginfo->info->callbacks->reloc_overflow)
+                     (flaginfo->info, (h ? &h->root : NULL), name,
+                      howto_table_ext[r_type].name,
+                      r_addend, input_bfd, input_section, r_addr);
                  }
                  break;
                }
@@ -4687,7 +4752,7 @@ aout_link_input_section_ext (struct aout_final_link_info *finfo,
 /* Link an a.out section into the output file.  */
 
 static bfd_boolean
-aout_link_input_section (struct aout_final_link_info *finfo,
+aout_link_input_section (struct aout_final_link_info *flaginfo,
                         bfd *input_bfd,
                         asection *input_section,
                         file_ptr *reloff_ptr,
@@ -4699,7 +4764,7 @@ aout_link_input_section (struct aout_final_link_info *finfo,
   /* Get the section contents.  */
   input_size = input_section->size;
   if (! bfd_get_section_contents (input_bfd, input_section,
-                                 (void *) finfo->contents,
+                                 (void *) flaginfo->contents,
                                  (file_ptr) 0, input_size))
     return FALSE;
 
@@ -4709,7 +4774,7 @@ aout_link_input_section (struct aout_final_link_info *finfo,
     relocs = aout_section_data (input_section)->relocs;
   else
     {
-      relocs = finfo->relocs;
+      relocs = flaginfo->relocs;
       if (rel_size > 0)
        {
          if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0
@@ -4721,44 +4786,44 @@ aout_link_input_section (struct aout_final_link_info *finfo,
   /* Relocate the section contents.  */
   if (obj_reloc_entry_size (input_bfd) == RELOC_STD_SIZE)
     {
-      if (! aout_link_input_section_std (finfo, input_bfd, input_section,
+      if (! aout_link_input_section_std (flaginfo, input_bfd, input_section,
                                         (struct reloc_std_external *) relocs,
-                                        rel_size, finfo->contents))
+                                        rel_size, flaginfo->contents))
        return FALSE;
     }
   else
     {
-      if (! aout_link_input_section_ext (finfo, input_bfd, input_section,
+      if (! aout_link_input_section_ext (flaginfo, input_bfd, input_section,
                                         (struct reloc_ext_external *) relocs,
-                                        rel_size, finfo->contents))
+                                        rel_size, flaginfo->contents))
        return FALSE;
     }
 
   /* Write out the section contents.  */
-  if (! bfd_set_section_contents (finfo->output_bfd,
+  if (! bfd_set_section_contents (flaginfo->output_bfd,
                                  input_section->output_section,
-                                 (void *) finfo->contents,
+                                 (void *) flaginfo->contents,
                                  (file_ptr) input_section->output_offset,
                                  input_size))
     return FALSE;
 
   /* If we are producing relocatable output, the relocs were
      modified, and we now write them out.  */
-  if (finfo->info->relocatable && rel_size > 0)
+  if (bfd_link_relocatable (flaginfo->info) && rel_size > 0)
     {
-      if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
+      if (bfd_seek (flaginfo->output_bfd, *reloff_ptr, SEEK_SET) != 0)
        return FALSE;
-      if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size)
+      if (bfd_bwrite (relocs, rel_size, flaginfo->output_bfd) != rel_size)
        return FALSE;
       *reloff_ptr += rel_size;
 
       /* Assert that the relocs have not run into the symbols, and
         that if these are the text relocs they have not run into the
         data relocs.  */
-      BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (finfo->output_bfd)
-                 && (reloff_ptr != &finfo->treloff
+      BFD_ASSERT (*reloff_ptr <= obj_sym_filepos (flaginfo->output_bfd)
+                 && (reloff_ptr != &flaginfo->treloff
                      || (*reloff_ptr
-                         <= obj_datasec (finfo->output_bfd)->rel_filepos)));
+                         <= obj_datasec (flaginfo->output_bfd)->rel_filepos)));
     }
 
   return TRUE;
@@ -4768,7 +4833,7 @@ aout_link_input_section (struct aout_final_link_info *finfo,
    symbol indices into a symbol_map.  */
 
 static bfd_boolean
-aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
+aout_link_write_symbols (struct aout_final_link_info *flaginfo, bfd *input_bfd)
 {
   bfd *output_bfd;
   bfd_size_type sym_count;
@@ -4784,25 +4849,25 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
   bfd_boolean pass;
   bfd_boolean skip_next;
 
-  output_bfd = finfo->output_bfd;
+  output_bfd = flaginfo->output_bfd;
   sym_count = obj_aout_external_sym_count (input_bfd);
   strings = obj_aout_external_strings (input_bfd);
-  strip = finfo->info->strip;
-  discard = finfo->info->discard;
-  outsym = finfo->output_syms;
+  strip = flaginfo->info->strip;
+  discard = flaginfo->info->discard;
+  outsym = flaginfo->output_syms;
 
   /* First write out a symbol for this object file, unless we are
      discarding such symbols.  */
   if (strip != strip_all
       && (strip != strip_some
-         || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename,
+         || bfd_hash_lookup (flaginfo->info->keep_hash, input_bfd->filename,
                              FALSE, FALSE) != NULL)
       && discard != discard_all)
     {
       H_PUT_8 (output_bfd, N_TEXT, outsym->e_type);
       H_PUT_8 (output_bfd, 0, outsym->e_other);
       H_PUT_16 (output_bfd, 0, outsym->e_desc);
-      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
+      strtab_index = add_to_stringtab (output_bfd, flaginfo->strtab,
                                       input_bfd->filename, FALSE);
       if (strtab_index == (bfd_size_type) -1)
        return FALSE;
@@ -4821,7 +4886,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
   sym = obj_aout_external_syms (input_bfd);
   sym_end = sym + sym_count;
   sym_hash = obj_aout_sym_hashes (input_bfd);
-  symbol_map = finfo->symbol_map;
+  symbol_map = flaginfo->symbol_map;
   memset (symbol_map, 0, (size_t) sym_count * sizeof *symbol_map);
   for (; sym < sym_end; sym++, sym_hash++, symbol_map++)
     {
@@ -4834,15 +4899,15 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
       bfd_boolean copy;
 
       /* We set *symbol_map to 0 above for all symbols.  If it has
-         already been set to -1 for this symbol, it means that we are
-         discarding it because it appears in a duplicate header file.
-         See the N_BINCL code below.  */
+        already been set to -1 for this symbol, it means that we are
+        discarding it because it appears in a duplicate header file.
+        See the N_BINCL code below.  */
       if (*symbol_map == -1)
        continue;
 
       /* Initialize *symbol_map to -1, which means that the symbol was
-         not copied into the output file.  We will change it later if
-         we do copy the symbol over.  */
+        not copied into the output file.  We will change it later if
+        we do copy the symbol over.  */
       *symbol_map = -1;
 
       type = H_GET_8 (input_bfd, sym->e_type);
@@ -4876,7 +4941,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
          h = *sym_hash;
 
          /* Use the name from the hash table, in case the symbol was
-             wrapped.  */
+            wrapped.  */
          if (h != NULL
              && h->root.type != bfd_link_hash_warning)
            name = h->root.root.string;
@@ -4920,7 +4985,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
                skip = TRUE;
              break;
            case strip_some:
-             if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE)
+             if (bfd_hash_lookup (flaginfo->info->keep_hash, name, FALSE, FALSE)
                  == NULL)
                skip = TRUE;
              break;
@@ -5146,10 +5211,10 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
                }
 
              /* If we have already included a header file with the
-                 same value, then replace this one with an N_EXCL
-                 symbol.  */
-             copy = (bfd_boolean) (! finfo->info->keep_memory);
-             incl_entry = aout_link_includes_lookup (&finfo->includes,
+                same value, then replace this one with an N_EXCL
+                symbol.  */
+             copy = (bfd_boolean) (! flaginfo->info->keep_memory);
+             incl_entry = aout_link_includes_lookup (&flaginfo->includes,
                                                      name, TRUE, copy);
              if (incl_entry == NULL)
                return FALSE;
@@ -5159,9 +5224,9 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
              if (t == NULL)
                {
                  /* This is the first time we have seen this header
-                     file with this set of stabs strings.  */
+                    file with this set of stabs strings.  */
                  t = (struct aout_link_includes_totals *)
-                      bfd_hash_allocate (&finfo->includes.root,
+                     bfd_hash_allocate (&flaginfo->includes.root,
                                         sizeof *t);
                  if (t == NULL)
                    return FALSE;
@@ -5174,8 +5239,8 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
                  int *incl_map;
 
                  /* This is a duplicate header file.  We must change
-                     it to be an N_EXCL entry, and mark all the
-                     included symbols to prevent outputting them.  */
+                    it to be an N_EXCL entry, and mark all the
+                    included symbols to prevent outputting them.  */
                  type = (int) N_EXCL;
 
                  nest = 0;
@@ -5210,7 +5275,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
       H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other);
       H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc);
       copy = FALSE;
-      if (! finfo->info->keep_memory)
+      if (! flaginfo->info->keep_memory)
        {
          /* name points into a string table which we are going to
             free.  If there is a hash table entry, use that string.
@@ -5220,7 +5285,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
          else
            copy = TRUE;
        }
-      strtab_index = add_to_stringtab (output_bfd, finfo->strtab,
+      strtab_index = add_to_stringtab (output_bfd, flaginfo->strtab,
                                       name, copy);
       if (strtab_index == (bfd_size_type) -1)
        return FALSE;
@@ -5232,18 +5297,18 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
     }
 
   /* Write out the output symbols we have just constructed.  */
-  if (outsym > finfo->output_syms)
+  if (outsym > flaginfo->output_syms)
     {
       bfd_size_type outsym_size;
 
-      if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0)
+      if (bfd_seek (output_bfd, flaginfo->symoff, SEEK_SET) != 0)
        return FALSE;
-      outsym_size = outsym - finfo->output_syms;
+      outsym_size = outsym - flaginfo->output_syms;
       outsym_size *= EXTERNAL_NLIST_SIZE;
-      if (bfd_bwrite ((void *) finfo->output_syms, outsym_size, output_bfd)
+      if (bfd_bwrite ((void *) flaginfo->output_syms, outsym_size, output_bfd)
          != outsym_size)
        return FALSE;
-      finfo->symoff += outsym_size;
+      flaginfo->symoff += outsym_size;
     }
 
   return TRUE;
@@ -5252,7 +5317,7 @@ aout_link_write_symbols (struct aout_final_link_info *finfo, bfd *input_bfd)
 /* Link an a.out input BFD into the output file.  */
 
 static bfd_boolean
-aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
+aout_link_input_bfd (struct aout_final_link_info *flaginfo, bfd *input_bfd)
 {
   BFD_ASSERT (bfd_get_format (input_bfd) == bfd_object);
 
@@ -5260,16 +5325,16 @@ aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
   if ((input_bfd->flags & DYNAMIC) != 0
       && aout_backend_info (input_bfd)->link_dynamic_object != NULL)
     return ((*aout_backend_info (input_bfd)->link_dynamic_object)
-           (finfo->info, input_bfd));
+           (flaginfo->info, input_bfd));
 
   /* Get the symbols.  We probably have them already, unless
-     finfo->info->keep_memory is FALSE.  */
+     flaginfo->info->keep_memory is FALSE.  */
   if (! aout_get_external_symbols (input_bfd))
     return FALSE;
 
   /* Write out the symbols and get a map of the new indices.  The map
-     is placed into finfo->symbol_map.  */
-  if (! aout_link_write_symbols (finfo, input_bfd))
+     is placed into flaginfo->symbol_map.  */
+  if (! aout_link_write_symbols (flaginfo, input_bfd))
     return FALSE;
 
   /* Relocate and write out the sections.  These functions use the
@@ -5278,17 +5343,17 @@ aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
      link, which will normally be the case.  */
   if (obj_textsec (input_bfd)->linker_mark)
     {
-      if (! aout_link_input_section (finfo, input_bfd,
+      if (! aout_link_input_section (flaginfo, input_bfd,
                                     obj_textsec (input_bfd),
-                                    &finfo->treloff,
+                                    &flaginfo->treloff,
                                     exec_hdr (input_bfd)->a_trsize))
        return FALSE;
     }
   if (obj_datasec (input_bfd)->linker_mark)
     {
-      if (! aout_link_input_section (finfo, input_bfd,
+      if (! aout_link_input_section (flaginfo, input_bfd,
                                     obj_datasec (input_bfd),
-                                    &finfo->dreloff,
+                                    &flaginfo->dreloff,
                                     exec_hdr (input_bfd)->a_drsize))
        return FALSE;
     }
@@ -5296,7 +5361,7 @@ aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
   /* If we are not keeping memory, we don't need the symbols any
      longer.  We still need them if we are keeping memory, because the
      strings in the hash table point into them.  */
-  if (! finfo->info->keep_memory)
+  if (! flaginfo->info->keep_memory)
     {
       if (! aout_link_free_symbols (input_bfd))
        return FALSE;
@@ -5307,7 +5372,7 @@ aout_link_input_bfd (struct aout_final_link_info *finfo, bfd *input_bfd)
 
 /* Do the final link step.  This is called on the output BFD.  The
    INFO structure should point to a list of BFDs linked through the
-   link_next field which can be used to find each BFD which takes part
+   link.next field which can be used to find each BFD which takes part
    in the output.  Also, each section in ABFD should point to a list
    of bfd_link_order structures which list all the input sections for
    the output section.  */
@@ -5324,13 +5389,11 @@ NAME (aout, final_link) (bfd *abfd,
   bfd_size_type max_contents_size;
   bfd_size_type max_relocs_size;
   bfd_size_type max_sym_count;
-  bfd_size_type text_size;
-  file_ptr text_end;
   struct bfd_link_order *p;
   asection *o;
   bfd_boolean have_link_order_relocs;
 
-  if (info->shared)
+  if (bfd_link_pic (info))
     abfd->flags |= DYNAMIC;
 
   aout_info.info = info;
@@ -5354,11 +5417,11 @@ NAME (aout, final_link) (bfd *abfd,
   max_contents_size = 0;
   max_relocs_size = 0;
   max_sym_count = 0;
-  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+  for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
     {
       bfd_size_type sz;
 
-      if (info->relocatable)
+      if (bfd_link_relocatable (info))
        {
          if (bfd_get_flavour (sub) == bfd_target_aout_flavour)
            {
@@ -5371,10 +5434,10 @@ NAME (aout, final_link) (bfd *abfd,
                 and call get_reloc_upper_bound and canonicalize_reloc to
                 work out the number of relocs needed, and then multiply
                 by the reloc size.  */
-             (*_bfd_error_handler)
-               (_("%s: relocatable link from %s to %s not supported"),
-                bfd_get_filename (abfd),
-                sub->xvec->name, abfd->xvec->name);
+             _bfd_error_handler
+               /* xgettext:c-format */
+               (_("%B: relocatable link from %s to %s not supported"),
+                abfd, sub->xvec->name, abfd->xvec->name);
              bfd_set_error (bfd_error_invalid_operation);
              goto error_return;
            }
@@ -5402,7 +5465,7 @@ NAME (aout, final_link) (bfd *abfd,
        }
     }
 
-  if (info->relocatable)
+  if (bfd_link_relocatable (info))
     {
       if (obj_textsec (abfd) != NULL)
        trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd)
@@ -5422,7 +5485,7 @@ NAME (aout, final_link) (bfd *abfd,
   /* Adjust the section sizes and vmas according to the magic number.
      This sets a_text, a_data and a_bss in the exec_hdr and sets the
      filepos for each section.  */
-  if (! NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end))
+  if (! NAME (aout, adjust_sizes_and_vmas) (abfd))
     goto error_return;
 
   /* The relocation and symbol file positions differ among a.out
@@ -5493,7 +5556,7 @@ NAME (aout, final_link) (bfd *abfd,
 
      We use the output_has_begun field of the input BFDs to see
      whether we have already handled it.  */
-  for (sub = info->input_bfds; sub != NULL; sub = sub->link_next)
+  for (sub = info->input_bfds; sub != NULL; sub = sub->link.next)
     sub->output_has_begun = FALSE;
 
   /* Mark all sections which are to be included in the link.  This
This page took 0.05217 seconds and 4 git commands to generate.