This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [mips patch rfa] remove MIPS ld --embedded-relocs support.
At 21 Apr 2004 12:13:06 -0400, Ian Lance Taylor wrote:
> Compare the parts of mipecoff.em that you don't understand to
> generic.em. I would not be surprised if they are essentially the
> same, and that mipsecoff.em can be removed, and all uses of
> mipsecoff.em in emulparams/* changed to generic.em.
So, the significant differences between the two files seem to be:
mipsecoff.em does:
if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
fi
and then where generic.em does:
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("`echo ${ARCH}`", bfd_arch_unknown);
#endif /* not TARGET_ */
mipsecoff.em does:
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
#endif /* not TARGET_ */
I don't see anything that will *ever* set TARGET_, so these bits look
relevant.
Given that, it should be very simple to change:
TEMPLATE_NAME=mipsecoff
to:
TEMPLATE_NAME=generic
EXTRA_EM_FILE=mipsecoff
and then have mipsecoff.em be a file as below.
Does that seem like a reasonable solution to you?
chris
--
# This shell script emits a C file. -*- C -*-
# Copyright 1994, 1995, 1997, 2000, 2002, 2003, 2004
# Free Software Foundation, Inc.
#
# This file is part of GLD, the Gnu Linker.
#
# 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 2 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
if [ -z "$MACHINE" ]; then
OUTPUT_ARCH=${ARCH}
else
OUTPUT_ARCH=${ARCH}:${MACHINE}
fi
cat >e${EMULATION_NAME}.c <<EOF
static void
mipsecoff_before_parse (void)
{
#ifndef TARGET_ /* I.e., if not generic. */
ldfile_set_output_arch ("${OUTPUT_ARCH}", bfd_arch_`echo ${ARCH} | sed -e 's/:.*//'`);
#endif /* not TARGET_ */
}
EOF
LDEMUL_BEFORE_PARSE=mipsecoff_before_parse