1 |
38 |
julius |
# This shell script emits a C file. -*- C -*-
|
2 |
|
|
# Copyright 2006, 2007, 2008 Free Software Foundation, Inc.
|
3 |
|
|
# Contributed by:
|
4 |
|
|
# Mei Ligang (ligang@sunnorth.com.cn)
|
5 |
|
|
# Pei-Lin Tsai (pltsai@sunplus.com)
|
6 |
|
|
|
7 |
|
|
# This file is part of the GNU Binutils.
|
8 |
|
|
#
|
9 |
|
|
# This program is free software; you can redistribute it and/or modify
|
10 |
|
|
# it under the terms of the GNU General Public License as published by
|
11 |
|
|
# the Free Software Foundation; either version 3 of the License, or
|
12 |
|
|
# (at your option) any later version.
|
13 |
|
|
#
|
14 |
|
|
# This program is distributed in the hope that it will be useful,
|
15 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
16 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
17 |
|
|
# GNU General Public License for more details.
|
18 |
|
|
#
|
19 |
|
|
# You should have received a copy of the GNU General Public License
|
20 |
|
|
# along with this program; if not, write to the Free Software
|
21 |
|
|
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
|
22 |
|
|
# MA 02110-1301, USA.
|
23 |
|
|
#
|
24 |
|
|
|
25 |
|
|
# This file is sourced from elf32.em, and defines extra score-elf
|
26 |
|
|
# specific routines.
|
27 |
|
|
#
|
28 |
|
|
fragment <
|
29 |
|
|
|
30 |
|
|
static void
|
31 |
|
|
gld${EMULATION_NAME}_before_parse ()
|
32 |
|
|
{
|
33 |
|
|
#ifndef TARGET_ /* I.e., if not generic. */
|
34 |
|
|
ldfile_set_output_arch ("`echo ${ARCH}`");
|
35 |
|
|
#endif /* not TARGET_ */
|
36 |
|
|
config.dynamic_link = ${DYNAMIC_LINK-true};
|
37 |
|
|
config.has_shared = `if test -n "$GENERATE_SHLIB_SCRIPT" ; then echo true ; else echo false ; fi`;
|
38 |
|
|
}
|
39 |
|
|
|
40 |
|
|
static void
|
41 |
|
|
score_elf_after_open (void)
|
42 |
|
|
{
|
43 |
|
|
if (strstr (bfd_get_target (link_info.output_bfd), "score") == NULL)
|
44 |
|
|
{
|
45 |
|
|
/* The score backend needs special fields in the output hash structure.
|
46 |
|
|
These will only be created if the output format is an score format,
|
47 |
|
|
hence we do not support linking and changing output formats at the
|
48 |
|
|
same time. Use a link followed by objcopy to change output formats. */
|
49 |
|
|
einfo ("%F%X%P: error: cannot change output format whilst linking S+core binaries\n");
|
50 |
|
|
return;
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
/* Call the standard elf routine. */
|
54 |
|
|
gld${EMULATION_NAME}_after_open ();
|
55 |
|
|
}
|
56 |
|
|
|
57 |
|
|
EOF
|
58 |
|
|
|
59 |
|
|
# We have our own after_open and before_allocation functions, but they call
|
60 |
|
|
# the standard routines, so give them a different name.
|
61 |
|
|
LDEMUL_AFTER_OPEN=score_elf_after_open
|
62 |
|
|
|
63 |
|
|
# Replace the elf before_parse function with our own.
|
64 |
|
|
LDEMUL_BEFORE_PARSE=gld"${EMULATION_NAME}"_before_parse
|