# It does some substitutions.
cat >e${EMULATION_NAME}.c <<EOF
/* intel coff loader emulation specific stuff
- Copyright 1991, 1992, 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright 1991, 1992, 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003,
+ 2005, 2007 Free Software Foundation, Inc.
Written by Steve Chamberlain steve@cygnus.com
This file is part of GLD, the Gnu Linker.
You should have received a copy of the GNU General Public License
along with GLD; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+the Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
+#include "sysdep.h"
#include "libiberty.h"
#include "bfd.h"
-#include "sysdep.h"
#include "bfdlink.h"
/*#include "archures.h"*/
static lib_list_type *syslib_list;
static lib_list_type **syslib_list_tail = &syslib_list;
-static void append PARAMS ((lib_list_type ***, char *));
-static void lnk960_hll PARAMS ((char *));
-static void lnk960_syslib PARAMS ((char *));
-static void lnk960_before_parse PARAMS ((void));
-static void add_on PARAMS ((lib_list_type *, lang_input_file_enum_type));
-static void lnk960_after_parse PARAMS ((void));
-static void lnk960_before_allocation PARAMS ((void));
-static void lnk960_after_allocation PARAMS ((void));
-static void lnk960_set_output_arch PARAMS ((void));
-static char *lnk960_choose_target PARAMS ((int, char **));
-static char *lnk960_get_script PARAMS ((int *));
-
static void
-append (list, name)
- lib_list_type ***list;
- char *name;
+append (lib_list_type ***list, char *name)
{
lib_list_type *element = (lib_list_type *) xmalloc (sizeof (lib_list_type));
static bfd_boolean had_hll_name = FALSE;
static void
-lnk960_hll (name)
- char *name;
+lnk960_hll (char *name)
{
had_hll = TRUE;
if (name != (char *) NULL)
}
}
-static void
-lnk960_syslib (name)
- char *name;
+static void
+lnk960_syslib (char *name)
{
append (&syslib_list_tail, name);
}
-#ifdef GNU960
-
-static void
-lnk960_before_parse ()
-{
- static char *env_variables[] = { "G960LIB", "G960BASE", 0 };
- char **p;
- char *env ;
-
- for (p = env_variables; *p; p++)
- {
- env = (char *) getenv (*p);
- if (env)
- ldfile_add_library_path (concat (env, "/lib/libcoff", ""), FALSE);
- }
-
- env = (char *) getenv ("I960BASE");
- if (env)
- ldfile_add_library_path(concat (env, "/lib", ""), FALSE);
-
- ldfile_output_architecture = bfd_arch_i960;
- ldfile_output_machine = bfd_mach_i960_core;
-}
-
-#else /* not GNU960 */
-
-static void
-lnk960_before_parse ()
+static void
+lnk960_before_parse (void)
{
char *name = getenv ("I960BASE");
einfo ("%P%F I960BASE and G960BASE not set\n");
}
-
- ldfile_add_library_path (concat (name, "/lib", ""), FALSE);
+ ldfile_add_library_path (concat (name, "/lib", NULL), FALSE);
ldfile_output_architecture = bfd_arch_i960;
ldfile_output_machine = bfd_mach_i960_core;
}
-#endif /* GNU960 */
-
-
static void
-add_on (list, search)
- lib_list_type *list;
- lang_input_file_enum_type search;
+add_on (lib_list_type *list, lang_input_file_enum_type search)
{
while (list)
{
list = list->next;
}
}
+
static void
-lnk960_after_parse ()
+lnk960_after_parse (void)
{
/* If there has been no arch, default to -KB */
if (ldfile_output_machine_name[0] == 0)
ldfile_add_arch ("KB");
/* if there has been no hll list then add our own */
-
+
if (had_hll && !had_hll_name)
{
append (&hll_list_tail, "cg");
|| ldfile_output_machine == bfd_mach_i960_ca)
append (&hll_list_tail, "fpg");
}
-
+
add_on (hll_list, lang_input_file_is_l_enum);
add_on (syslib_list, lang_input_file_is_search_file_enum);
}
static void
-lnk960_before_allocation ()
-{
-}
-
-static void
-lnk960_after_allocation ()
+lnk960_after_allocation (void)
{
if (!link_info.relocatable)
{
static struct
{
unsigned long number;
- char *name;
+ char *name;
}
machine_table[] =
{
};
static void
-lnk960_set_output_arch ()
+lnk960_set_output_arch (void)
{
/* Set the output architecture and machine if possible */
unsigned int i;
}
static char *
-lnk960_choose_target (argc, argv)
- int argc ATTRIBUTE_UNUSED;
- char **argv ATTRIBUTE_UNUSED;
+lnk960_choose_target (int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
{
-#ifdef GNU960
-
- return bfd_make_targ_name (BFD_COFF_FORMAT, 0);
-
-#else
-
char *from_outside = getenv (TARGET_ENVIRON);
if (from_outside != (char *) NULL)
return from_outside;
#else
return "coff-Intel-big";
#endif
-#endif
-
}
static char *
-lnk960_get_script (isfile)
- int *isfile;
+lnk960_get_script (int *isfile)
EOF
if test -n "$COMPILE_IN"
sc="-f stringify.sed"
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 0;
if (link_info.relocatable && config.build_constructors)
# Scripts read from the filesystem.
cat >>e${EMULATION_NAME}.c <<EOF
-{
+{
*isfile = 1;
if (link_info.relocatable && config.build_constructors)
cat >>e${EMULATION_NAME}.c <<EOF
-struct ld_emulation_xfer_struct ld_lnk960_emulation =
+struct ld_emulation_xfer_struct ld_lnk960_emulation =
{
lnk960_before_parse,
lnk960_syslib,
lnk960_after_allocation,
lnk960_set_output_arch,
lnk960_choose_target,
- lnk960_before_allocation,
+ before_allocation_default,
lnk960_get_script,
"lnk960",
"",
- NULL, /* finish */
+ finish_default,
NULL, /* create output section statements */
NULL, /* open dynamic archive */
NULL, /* place orphan */