Add new port: crx-elf
[binutils-gdb.git] / ld / emultempl / crxelf.em
1 # This shell script emits a C file. -*- C -*-
2 # Copyright 2004
3 # Free Software Foundation, Inc.
4 #
5 # This file is part of GLD, the Gnu Linker.
6 #
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
11 #
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #
21
22 # This file is sourced from elf32.em, and defines extra crx-elf
23 # specific routines.
24 #
25 cat >>e${EMULATION_NAME}.c <<EOF
26
27 #include "ldctor.h"
28
29 static void crxelf_after_parse (void);
30
31 static void
32 crxelf_after_parse (void)
33 {
34 /* Always behave as if called with --sort-common command line
35 option.
36 This is to emulate the CRTools' method of keeping variables
37 of different alignment in separate sections. */
38 config.sort_common = TRUE;
39
40 /* Don't create a demand-paged executable, since this feature isn't
41 meaninful in CR16C embedded systems. Moreover, when magic_demand_paged
42 is true the link sometimes fails. */
43 config.magic_demand_paged = FALSE;
44 }
45
46 EOF
47
48 # Put these extra crx-elf routines in ld_${EMULATION_NAME}_emulation
49 #
50 LDEMUL_AFTER_PARSE=crxelf_after_parse