1 # This shell script emits a C file. -*- C -*-
2 # Copyright 2011 Free Software Foundation, Inc.
4 # This file is part of the GNU Binutils.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
22 # This file is sourced from elf32.em, and defines extra C6X DSBT specific
27 #include "elf32-tic6x.h"
29 static struct elf32_tic6x_params params =
35 is_tic6x_target (void)
37 extern const bfd_target bfd_elf32_tic6x_le_vec;
38 extern const bfd_target bfd_elf32_tic6x_be_vec;
40 return (link_info.output_bfd->xvec == &bfd_elf32_tic6x_le_vec
41 || link_info.output_bfd->xvec == &bfd_elf32_tic6x_be_vec);
44 /* Pass params to backend. */
47 tic6x_after_open (void)
49 if (is_tic6x_target ())
51 if (params.dsbt_index >= params.dsbt_size)
53 einfo (_("%P%F: invalid --dsbt-index %d, outside DSBT size.\n"),
56 elf32_tic6x_setup (&link_info, ¶ms);
59 gld${EMULATION_NAME}_after_open ();
63 # This code gets inserted into the generic elf32.sc linker script
64 # and allows us to define our own command line switches.
65 PARSE_AND_LIST_PROLOGUE='
66 #define OPTION_DSBT_INDEX 300
67 #define OPTION_DSBT_SIZE 301
70 PARSE_AND_LIST_LONGOPTS='
71 {"dsbt-index", required_argument, NULL, OPTION_DSBT_INDEX},
72 {"dsbt-size", required_argument, NULL, OPTION_DSBT_SIZE},
75 PARSE_AND_LIST_OPTIONS='
76 fprintf (file, _(" --dsbt-index <index>\n"));
77 fprintf (file, _("\t\t\tUse this as the DSBT index for the output object\n"));
78 fprintf (file, _(" --dsbt-size <index>\n"));
79 fprintf (file, _("\t\t\tUse this as the number of entries in the DSBT table\n"));
82 PARSE_AND_LIST_ARGS_CASES='
83 case OPTION_DSBT_INDEX:
86 params.dsbt_index = strtol (optarg, &end, 0);
88 && params.dsbt_index >= 0 && params.dsbt_index < 0x7fff)
90 einfo (_("%P%F: invalid --dsbt-index %s\n"), optarg);
93 case OPTION_DSBT_SIZE:
96 params.dsbt_size = strtol (optarg, &end, 0);
98 && params.dsbt_size >= 0 && params.dsbt_size < 0x7fff)
100 einfo (_("%P%F: invalid --dsbt-size %s\n"), optarg);
105 LDEMUL_AFTER_OPEN=tic6x_after_open