/* This file is is generated by a shell script.  DO NOT EDIT! */

/* emulate the original gld for the given i386msdos
   Copyright (C) 1991-2022 Free Software Foundation, Inc.
   Written by Steve Chamberlain steve@cygnus.com

   This file is part of the GNU Binutils.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

#define TARGET_IS_i386msdos

#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "ctf-api.h"

#include "ld.h"
#include "ldmain.h"
#include "ldmisc.h"

#include "ldexp.h"
#include "ldlang.h"
#include "ldfile.h"
#include "ldemul.h"


static void
gldi386msdos_before_parse (void)
{
#ifndef TARGET_			/* I.e., if not generic.  */
  ldfile_set_output_arch ("i386", bfd_arch_unknown);
#endif /* not TARGET_ */
}


static char *
gldi386msdos_get_script (int *isfile)
{
  *isfile = 1;

  if (bfd_link_relocatable (&link_info) && config.build_constructors)
    return "ldscripts/i386msdos.xu";
  else if (bfd_link_relocatable (&link_info))
    return "ldscripts/i386msdos.xr";
  else if (!config.text_read_only)
    return "ldscripts/i386msdos.xbn";
  else if (!config.magic_demand_paged)
    return "ldscripts/i386msdos.xn";
  else
    return "ldscripts/i386msdos.x";
}

struct ld_emulation_xfer_struct ld_i386msdos_emulation =
{
  gldi386msdos_before_parse,
  syslib_default,
  hll_default,
  after_parse_default,
  NULL,
  after_open_default,
  after_check_relocs_default,
  before_place_orphans_default,
  after_allocation_default,
  set_output_arch_default,
  ldemul_default_target,
  before_allocation_default,
  gldi386msdos_get_script,
  "i386msdos",
  "msdos",
  finish_default,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL,
  NULL
};
