binutils-gdb/ld/emultempl/vanilla.em
H.J. Lu a92613915e ld: Add emultempl/emulation.em
Add emultempl/emulation.em to define ld_${EMULATION_NAME}_emulation so
that new emulation hooks can be added easily.

	* emultempl/aix.em (LDEMUL_AFTER_OPEN): New.
	(LDEMUL_SET_OUTPUT_ARCH): Likewise.
	(LDEMUL_CHOOSE_TARGET): Likewise.
	(LDEMUL_BEFORE_ALLOCATION): Likewise.
	(LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS): Likewise.
	(LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise.
	(LDEMUL_PARSE_ARGS): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_UNRECOGNIZED_FILE): Likewise.
	(LDEMUL_PRINT_SYMBOL): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/beos.em (gld_${EMULATION_NAME}_before_parse):
	Renamed to ...
	(gld${EMULATION_NAME}_before_parse): This.
	(gld_${EMULATION_NAME}_set_symbols): Renamed to ...
	(gld${EMULATION_NAME}_set_symbols): This.
	(gld_${EMULATION_NAME}_after_open): Renamed to ...
	(gld${EMULATION_NAME}_after_open): This.
	(gld_${EMULATION_NAME}_before_allocation): Renamed to ...
	(gld${EMULATION_NAME}_before_allocation): This.
	(gld_${EMULATION_NAME}_get_script): Renamed to ...
	(gld${EMULATION_NAME}_get_script): This.
	(LDEMUL_AFTER_OPEN): New.
	(LDEMUL_BEFORE_ALLOCATION): Likewise.
	(LDEMUL_PLACE_ORPHAN): Likewise.
	(LDEMUL_SET_SYMBOLS): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/elf.em (LDEMUL_AFTER_PARSE): New.
	(LDEMUL_AFTER_OPEN): Likewise.
	(LDEMUL_BEFORE_PLACE_ORPHANS): Likewise.
	(LDEMUL_AFTER_ALLOCATION): Likewise.
	(LDEMUL_SET_OUTPUT_ARCH): Likewise.
	(LDEMUL_BEFORE_ALLOCATION): Likewise.
	(LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise.
	(LDEMUL_PLACE_ORPHAN): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_LIST_OPTIONS): Likewise.
	(LDEMUL_UNRECOGNIZED_FILE): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/emulation.em: New file.
	* emultempl/generic.em (ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/msp430.em (LDEMUL_AFTER_OPEN): New.
	(LDEMUL_AFTER_ALLOCATION): Likewise.
	(LDEMUL_PLACE_ORPHAN): Likewise.
	(LDEMUL_FINISH): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_LIST_OPTIONS): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/pe.em (gld_${EMULATION_NAME}_before_parse): Renamed
	to ...
	(gld${EMULATION_NAME}_before_parse): This.
	(gld_${EMULATION_NAME}_list_options): Renamed to ...
	(gld${EMULATION_NAME}_list_options): This.
	(gld_${EMULATION_NAME}_set_symbols): Renamed to ...
	(gld${EMULATION_NAME}_set_symbols): This.
	(gld_${EMULATION_NAME}_after_parse): Renamed to ...
	(gld${EMULATION_NAME}_after_parse): This.
	(gld_${EMULATION_NAME}_after_open): Renamed to ...
	(gld${EMULATION_NAME}_after_open): This.
	(gld_${EMULATION_NAME}_before_allocation): Renamed to ...
	(gld${EMULATION_NAME}_before_allocation): This.
	(gld_${EMULATION_NAME}_unrecognized_file): Renamed to ...
	(gld${EMULATION_NAME}_unrecognized_file): This.
	(gld_${EMULATION_NAME}_recognized_file): Renamed to ...
	(gld${EMULATION_NAME}_recognized_file): This.
	(gld_${EMULATION_NAME}_finish): Renamed to ...
	(gld${EMULATION_NAME}_finish): This.
	(gld_${EMULATION_NAME}_place_orphan): Renamed to ...
	(gld${EMULATION_NAME}_place_orphan): This.
	(gld_${EMULATION_NAME}_open_dynamic_archive): Renamed to ...
	(gld${EMULATION_NAME}_open_dynamic_archive): This.
	(gld_${EMULATION_NAME}_find_potential_libraries): Renamed to ...
	(gld${EMULATION_NAME}_find_potential_libraries): This.
	(gld_${EMULATION_NAME}_get_script): Renamed to ...
	(gld${EMULATION_NAME}_get_script): This.
	(LDEMUL_AFTER_PARSE): New.
	(LDEMUL_AFTER_OPEN): Likewise.
	(LDEMUL_BEFORE_ALLOCATION): Likewise.
	(LDEMUL_FINISH=): Likewise.
	(LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise.
	(LDEMUL_PLACE_ORPHAN): Likewise.
	(LDEMUL_SET_SYMBOLS): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_UNRECOGNIZED_FILE): Likewise.
	(LDEMUL_LIST_OPTIONS): Likewise.
	(LDEMUL_RECOGNIZED_FILE): Likewise.
	(LDEMUL_FIND_POTENTIAL_LIBRARIES): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/pep.em (gld_${EMULATION_NAME}_before_parse): Renamed
	to ...
	(gld${EMULATION_NAME}_before_parse): This.
	(gld_${EMULATION_NAME}_list_options): Renamed to ...
	(gld${EMULATION_NAME}_list_options): This.
	(gld_${EMULATION_NAME}_set_symbols): Renamed to ...
	(gld${EMULATION_NAME}_set_symbols): This.
	(gld_${EMULATION_NAME}_after_parse): Renamed to ...
	(gld${EMULATION_NAME}_after_parse): This.
	(gld_${EMULATION_NAME}_after_open): Renamed to ...
	(gld${EMULATION_NAME}_after_open): This.
	(gld_${EMULATION_NAME}_before_allocation): Renamed to ...
	(gld${EMULATION_NAME}_before_allocation): This.
	(gld_${EMULATION_NAME}_unrecognized_file): Renamed to ...
	(gld${EMULATION_NAME}_unrecognized_file): This.
	(gld_${EMULATION_NAME}_recognized_file): Renamed to ...
	(gld${EMULATION_NAME}_recognized_file): This.
	(gld_${EMULATION_NAME}_finish): Renamed to ...
	(gld${EMULATION_NAME}_finish): This.
	(gld_${EMULATION_NAME}_place_orphan): Renamed to ...
	(gld${EMULATION_NAME}_place_orphan): This.
	(gld_${EMULATION_NAME}_open_dynamic_archive): Renamed to ...
	(gld${EMULATION_NAME}_open_dynamic_archive): This.
	(gld_${EMULATION_NAME}_find_potential_libraries): Renamed to ...
	(gld${EMULATION_NAME}_find_potential_libraries): This.
	(gld_${EMULATION_NAME}_get_script): Renamed to ...
	(gld${EMULATION_NAME}_get_script): This.
	(LDEMUL_AFTER_PARSE): New.
	(LDEMUL_AFTER_OPEN): Likewise.
	(LDEMUL_BEFORE_ALLOCATION): Likewise.
	(LDEMUL_FINISH=): Likewise.
	(LDEMUL_OPEN_DYNAMIC_ARCHIVE): Likewise.
	(LDEMUL_PLACE_ORPHAN): Likewise.
	(LDEMUL_SET_SYMBOLS): Likewise.
	(LDEMUL_ADD_OPTIONS): Likewise.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_UNRECOGNIZED_FILE): Likewise.
	(LDEMUL_LIST_OPTIONS): Likewise.
	(LDEMUL_RECOGNIZED_FILE): Likewise.
	(LDEMUL_FIND_POTENTIAL_LIBRARIES): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/ticoff.em (gld_${EMULATION_NAME}_list_options):
	Renamed to ...
	(gld${EMULATION_NAME}_list_options): This.
	(gld_${EMULATION_NAME}_before_parse): Renamed to ...
	(gld_${EMULATION_NAME}_get_script): Renamed to ...
	(gld${EMULATION_NAME}_get_script): This.
	(LDEMUL_ADD_OPTIONS): New.
	(LDEMUL_HANDLE_OPTION): Likewise.
	(LDEMUL_LIST_OPTIONS): Likewise.
	(ld_${EMULATION_NAME}_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
	* emultempl/vanilla.em (LDEMUL_BEFORE_PARSE): New.
	(LDEMUL_SET_OUTPUT_ARCH): Likewise.
	(LDEMUL_GET_SCRIPT): Likewise.
	(EMULATION_NAME): Likewise.
	(OUTPUT_FORMAT): Likewise.
	(ld_vanilla_emulation): Removed.
	Source ${srcdir}/emultempl/emulation.em.
2022-02-06 06:25:41 -08:00

67 lines
1.8 KiB
Plaintext

# This shell script emits a C file. -*- C -*-
# It does some substitutions.
fragment <<EOF
/* A vanilla emulation with no defaults
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. */
#include "sysdep.h"
#include "bfd.h"
#include "bfdlink.h"
#include "ctf-api.h"
#include "ld.h"
#include "ldmisc.h"
#include "ldmain.h"
#include "ldexp.h"
#include "ldlang.h"
#include "ldfile.h"
#include "ldemul.h"
static void vanilla_before_parse (void)
{
}
static void
vanilla_set_output_arch (void)
{
/* Set the output architecture and machine if possible */
unsigned long machine = 0;
bfd_set_arch_mach (link_info.output_bfd,
ldfile_output_architecture, machine);
}
static char *
vanilla_get_script (int *isfile)
{
*isfile = 0;
return "";
}
EOF
LDEMUL_BEFORE_PARSE=vanilla_before_parse
LDEMUL_SET_OUTPUT_ARCH=vanilla_set_output_arch
LDEMUL_GET_SCRIPT=vanilla_get_script
EMULATION_NAME=vanilla
OUTPUT_FORMAT=a.out-sunos-big
source_em ${srcdir}/emultempl/emulation.em