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