xref: /openbsd-src/gnu/usr.bin/binutils/bfd/aout-tic30.c (revision cf2f2c5620d6d9a4fd01930983c4b9a1f76d7aa3)
1f7cc78ecSespie /* BFD back-end for TMS320C30 a.out binaries.
2d2201f2fSdrahn    Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
3f7cc78ecSespie    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
4f7cc78ecSespie 
5f7cc78ecSespie    This file is part of BFD, the Binary File Descriptor library.
6f7cc78ecSespie 
7f7cc78ecSespie    This program is free software; you can redistribute it and/or modify
8f7cc78ecSespie    it under the terms of the GNU General Public License as published by
9f7cc78ecSespie    the Free Software Foundation; either version 2 of the License, or
10f7cc78ecSespie    (at your option) any later version.
11f7cc78ecSespie 
12f7cc78ecSespie    This program is distributed in the hope that it will be useful,
13f7cc78ecSespie    but WITHOUT ANY WARRANTY; without even the implied warranty of
14f7cc78ecSespie    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15f7cc78ecSespie    GNU General Public License for more details.
16f7cc78ecSespie 
17f7cc78ecSespie    You should have received a copy of the GNU General Public License
18f7cc78ecSespie    along with this program; if not, write to the Free Software
19f7cc78ecSespie    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20f7cc78ecSespie    02111-1307, USA.  */
21f7cc78ecSespie 
22f7cc78ecSespie #define TARGET_IS_BIG_ENDIAN_P
23f7cc78ecSespie #define N_HEADER_IN_TEXT(x) 1
24f7cc78ecSespie #define TEXT_START_ADDR 1024
25f7cc78ecSespie #define TARGET_PAGE_SIZE 128
26f7cc78ecSespie #define SEGMENT_SIZE TARGET_PAGE_SIZE
27f7cc78ecSespie #define DEFAULT_ARCH bfd_arch_tic30
28f7cc78ecSespie #define ARCH_SIZE 32
29f7cc78ecSespie 
30d2201f2fSdrahn /* Do not "beautify" the CONCAT* macro args.  Traditional C will not
31d2201f2fSdrahn    remove whitespace added here, and thus will fail to concatenate
32d2201f2fSdrahn    the tokens.  */
33d2201f2fSdrahn #define MY(OP) CONCAT2 (tic30_aout_,OP)
34f7cc78ecSespie #define TARGETNAME "a.out-tic30"
35d2201f2fSdrahn #define NAME(x,y) CONCAT3 (tic30_aout,_32_,y)
36f7cc78ecSespie 
37f7cc78ecSespie #include "bfd.h"
38f7cc78ecSespie #include "sysdep.h"
39f7cc78ecSespie #include "libaout.h"
40f7cc78ecSespie 
41f7cc78ecSespie #include "aout/aout64.h"
42f7cc78ecSespie #include "aout/stab_gnu.h"
43f7cc78ecSespie #include "aout/ar.h"
44f7cc78ecSespie 
45f7cc78ecSespie static bfd_reloc_status_type tic30_aout_fix_16
46f7cc78ecSespie   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
47f7cc78ecSespie static bfd_reloc_status_type tic30_aout_fix_32
48f7cc78ecSespie   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
49f7cc78ecSespie static bfd_reloc_status_type tic30_aout_fix_pcrel_16
50f7cc78ecSespie   PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **));
51f7cc78ecSespie static reloc_howto_type *tic30_aout_reloc_howto
52f7cc78ecSespie   PARAMS ((bfd *, struct reloc_std_external *, int *, int *, int *));
53f7cc78ecSespie static bfd_reloc_status_type tic30_aout_relocate_contents
54f7cc78ecSespie   PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *));
55f7cc78ecSespie static bfd_reloc_status_type tic30_aout_final_link_relocate
56f7cc78ecSespie   PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, bfd_vma,
57f7cc78ecSespie 	   bfd_vma, bfd_vma));
58d2201f2fSdrahn static const bfd_target *tic30_aout_object_p
59d2201f2fSdrahn   PARAMS ((bfd *));
60d2201f2fSdrahn static bfd_boolean tic30_aout_write_object_contents
61d2201f2fSdrahn   PARAMS ((bfd *));
62d2201f2fSdrahn static bfd_boolean tic30_aout_set_sizes
63d2201f2fSdrahn   PARAMS ((bfd *));
64d2201f2fSdrahn static const bfd_target * tic30_aout_callback
65d2201f2fSdrahn   PARAMS ((bfd *));
66d2201f2fSdrahn static bfd_boolean MY_bfd_copy_private_section_data
67d2201f2fSdrahn   PARAMS ((bfd *, asection *, bfd *, asection *));
68d2201f2fSdrahn static bfd_boolean MY_bfd_final_link
69d2201f2fSdrahn   PARAMS ((bfd *, struct bfd_link_info *));
70d2201f2fSdrahn reloc_howto_type * tic30_aout_reloc_type_lookup
71d2201f2fSdrahn   PARAMS ((bfd *, bfd_reloc_code_real_type));
72d2201f2fSdrahn enum machine_type tic30_aout_machine_type
73d2201f2fSdrahn   PARAMS ((enum bfd_architecture, unsigned long, bfd_boolean *));
74d2201f2fSdrahn bfd_boolean tic30_aout_set_arch_mach
75d2201f2fSdrahn   PARAMS ((bfd *, enum bfd_architecture, unsigned long));
76f7cc78ecSespie 
77d2201f2fSdrahn #define MY_reloc_howto(BFD, REL, IN, EX, PC) \
78d2201f2fSdrahn   tic30_aout_reloc_howto(BFD, REL, &IN, &EX, &PC)
79f7cc78ecSespie #define MY_final_link_relocate tic30_aout_final_link_relocate
80f7cc78ecSespie #define MY_object_p tic30_aout_object_p
81f7cc78ecSespie #define MY_mkobject NAME(aout,mkobject)
82f7cc78ecSespie #define MY_write_object_contents tic30_aout_write_object_contents
83f7cc78ecSespie #define MY_set_sizes tic30_aout_set_sizes
84f7cc78ecSespie 
85f7cc78ecSespie #ifndef MY_exec_hdr_flags
86f7cc78ecSespie #define MY_exec_hdr_flags 1
87f7cc78ecSespie #endif
88f7cc78ecSespie 
89f7cc78ecSespie #ifndef MY_backend_data
90f7cc78ecSespie 
91f7cc78ecSespie #ifndef MY_zmagic_contiguous
92f7cc78ecSespie #define MY_zmagic_contiguous 0
93f7cc78ecSespie #endif
94f7cc78ecSespie #ifndef MY_text_includes_header
95f7cc78ecSespie #define MY_text_includes_header 0
96f7cc78ecSespie #endif
97f7cc78ecSespie #ifndef MY_entry_is_text_address
98f7cc78ecSespie #define MY_entry_is_text_address 0
99f7cc78ecSespie #endif
100f7cc78ecSespie #ifndef MY_exec_header_not_counted
101f7cc78ecSespie #define MY_exec_header_not_counted 1
102f7cc78ecSespie #endif
103f7cc78ecSespie #ifndef MY_add_dynamic_symbols
104f7cc78ecSespie #define MY_add_dynamic_symbols 0
105f7cc78ecSespie #endif
106f7cc78ecSespie #ifndef MY_add_one_symbol
107f7cc78ecSespie #define MY_add_one_symbol 0
108f7cc78ecSespie #endif
109f7cc78ecSespie #ifndef MY_link_dynamic_object
110f7cc78ecSespie #define MY_link_dynamic_object 0
111f7cc78ecSespie #endif
112f7cc78ecSespie #ifndef MY_write_dynamic_symbol
113f7cc78ecSespie #define MY_write_dynamic_symbol 0
114f7cc78ecSespie #endif
115f7cc78ecSespie #ifndef MY_check_dynamic_reloc
116f7cc78ecSespie #define MY_check_dynamic_reloc 0
117f7cc78ecSespie #endif
118f7cc78ecSespie #ifndef MY_finish_dynamic_link
119f7cc78ecSespie #define MY_finish_dynamic_link 0
120f7cc78ecSespie #endif
121f7cc78ecSespie 
122d2201f2fSdrahn static const struct aout_backend_data tic30_aout_backend_data =
123f7cc78ecSespie {
124f7cc78ecSespie   MY_zmagic_contiguous,
125f7cc78ecSespie   MY_text_includes_header,
126f7cc78ecSespie   MY_entry_is_text_address,
127f7cc78ecSespie   MY_exec_hdr_flags,
128f7cc78ecSespie   0,				/* text vma? */
129f7cc78ecSespie   MY_set_sizes,
130f7cc78ecSespie   MY_exec_header_not_counted,
131f7cc78ecSespie   MY_add_dynamic_symbols,
132f7cc78ecSespie   MY_add_one_symbol,
133f7cc78ecSespie   MY_link_dynamic_object,
134f7cc78ecSespie   MY_write_dynamic_symbol,
135f7cc78ecSespie   MY_check_dynamic_reloc,
136f7cc78ecSespie   MY_finish_dynamic_link
137f7cc78ecSespie };
138f7cc78ecSespie #define MY_backend_data &tic30_aout_backend_data
139f7cc78ecSespie #endif
140f7cc78ecSespie 
141f7cc78ecSespie /* FIXME: This is wrong.  aoutx.h should really only be included by
142f7cc78ecSespie    aout32.c.  */
143f7cc78ecSespie 
144f7cc78ecSespie #include "aoutx.h"
145f7cc78ecSespie 
146f7cc78ecSespie /* This table lists the relocation types for the TMS320C30.  There are
147f7cc78ecSespie    only a few relocations required, and all must be divided by 4 (>>
148f7cc78ecSespie    2) to get the 32-bit addresses in the format the TMS320C30 likes
149f7cc78ecSespie    it.  */
150f7cc78ecSespie reloc_howto_type tic30_aout_howto_table[] =
151f7cc78ecSespie   {
152f7cc78ecSespie     EMPTY_HOWTO (-1),
153d2201f2fSdrahn     HOWTO (1, 2, 1, 16, FALSE, 0, 0, tic30_aout_fix_16,
154d2201f2fSdrahn 	   "16", FALSE, 0x0000FFFF, 0x0000FFFF, FALSE),
155d2201f2fSdrahn     HOWTO (2, 2, 2, 24, FALSE, 0, complain_overflow_bitfield, NULL,
156d2201f2fSdrahn 	   "24", FALSE, 0x00FFFFFF, 0x00FFFFFF, FALSE),
157d2201f2fSdrahn     HOWTO (3, 18, 3, 24, FALSE, 0, complain_overflow_bitfield, NULL,
158d2201f2fSdrahn 	   "LDP", FALSE, 0x00FF0000, 0x000000FF, FALSE),
159d2201f2fSdrahn     HOWTO (4, 2, 4, 32, FALSE, 0, complain_overflow_bitfield, tic30_aout_fix_32,
160d2201f2fSdrahn 	   "32", FALSE, 0xFFFFFFFF, 0xFFFFFFFF, FALSE),
161d2201f2fSdrahn     HOWTO (5, 2, 1, 16, TRUE, 0, complain_overflow_signed,
162d2201f2fSdrahn 	   tic30_aout_fix_pcrel_16, "PCREL", TRUE, 0x0000FFFF, 0x0000FFFF, TRUE),
163f7cc78ecSespie     EMPTY_HOWTO (-1),
164f7cc78ecSespie     EMPTY_HOWTO (-1),
165f7cc78ecSespie     EMPTY_HOWTO (-1),
166f7cc78ecSespie     EMPTY_HOWTO (-1),
167f7cc78ecSespie     EMPTY_HOWTO (-1)
168f7cc78ecSespie   };
169f7cc78ecSespie 
170d2201f2fSdrahn extern reloc_howto_type *NAME (aout, reloc_type_lookup)
171d2201f2fSdrahn   PARAMS ((bfd *, bfd_reloc_code_real_type));
172f7cc78ecSespie 
173f7cc78ecSespie reloc_howto_type *
tic30_aout_reloc_type_lookup(abfd,code)174f7cc78ecSespie tic30_aout_reloc_type_lookup (abfd, code)
175f7cc78ecSespie      bfd *abfd ATTRIBUTE_UNUSED;
176f7cc78ecSespie      bfd_reloc_code_real_type code;
177f7cc78ecSespie {
178f7cc78ecSespie   switch (code)
179f7cc78ecSespie     {
180f7cc78ecSespie     case BFD_RELOC_8:
181f7cc78ecSespie     case BFD_RELOC_TIC30_LDP:
182f7cc78ecSespie       return &tic30_aout_howto_table[3];
183f7cc78ecSespie     case BFD_RELOC_16:
184f7cc78ecSespie       return &tic30_aout_howto_table[1];
185f7cc78ecSespie     case BFD_RELOC_24:
186f7cc78ecSespie       return &tic30_aout_howto_table[2];
187f7cc78ecSespie     case BFD_RELOC_16_PCREL:
188f7cc78ecSespie       return &tic30_aout_howto_table[5];
189f7cc78ecSespie     case BFD_RELOC_32:
190f7cc78ecSespie       return &tic30_aout_howto_table[4];
191f7cc78ecSespie     default:
192f7cc78ecSespie       return (reloc_howto_type *) NULL;
193f7cc78ecSespie     }
194f7cc78ecSespie }
195f7cc78ecSespie 
196f7cc78ecSespie static reloc_howto_type *
tic30_aout_reloc_howto(abfd,relocs,r_index,r_extern,r_pcrel)197f7cc78ecSespie tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel)
198f7cc78ecSespie      bfd *abfd;
199f7cc78ecSespie      struct reloc_std_external *relocs;
200f7cc78ecSespie      int *r_index;
201f7cc78ecSespie      int *r_extern;
202f7cc78ecSespie      int *r_pcrel;
203f7cc78ecSespie {
204f7cc78ecSespie   unsigned int r_length;
205f7cc78ecSespie   unsigned int r_pcrel_done;
206f7cc78ecSespie   int index;
207f7cc78ecSespie 
208f7cc78ecSespie   *r_pcrel = 0;
209f7cc78ecSespie   if (bfd_header_big_endian (abfd))
210f7cc78ecSespie     {
211f7cc78ecSespie       *r_index = ((relocs->r_index[0] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[2]);
212f7cc78ecSespie       *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_BIG));
213f7cc78ecSespie       r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_BIG));
214f7cc78ecSespie       r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_BIG) >> RELOC_STD_BITS_LENGTH_SH_BIG);
215f7cc78ecSespie     }
216f7cc78ecSespie   else
217f7cc78ecSespie     {
218f7cc78ecSespie       *r_index = ((relocs->r_index[2] << 16) | (relocs->r_index[1] << 8) | relocs->r_index[0]);
219f7cc78ecSespie       *r_extern = (0 != (relocs->r_type[0] & RELOC_STD_BITS_EXTERN_LITTLE));
220f7cc78ecSespie       r_pcrel_done = (0 != (relocs->r_type[0] & RELOC_STD_BITS_PCREL_LITTLE));
221f7cc78ecSespie       r_length = ((relocs->r_type[0] & RELOC_STD_BITS_LENGTH_LITTLE) >> RELOC_STD_BITS_LENGTH_SH_LITTLE);
222f7cc78ecSespie     }
223f7cc78ecSespie   index = r_length + 4 * r_pcrel_done;
224f7cc78ecSespie   return tic30_aout_howto_table + index;
225f7cc78ecSespie }
226f7cc78ecSespie 
227f7cc78ecSespie /* This function is used as a callback for 16-bit relocs.  This is
228f7cc78ecSespie    required for relocations between segments.  A line in aoutx.h
229f7cc78ecSespie    requires that any relocations for the data section should point to
230f7cc78ecSespie    the end of the aligned text section, plus an offset.  By default,
231f7cc78ecSespie    this does not happen, therefore this function takes care of
232f7cc78ecSespie    that.  */
233f7cc78ecSespie 
234f7cc78ecSespie static bfd_reloc_status_type
tic30_aout_fix_16(abfd,reloc_entry,symbol,data,input_section,output_bfd,error_message)235f7cc78ecSespie tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message)
236f7cc78ecSespie      bfd *abfd;
237f7cc78ecSespie      arelent *reloc_entry;
238f7cc78ecSespie      asymbol *symbol;
239f7cc78ecSespie      PTR data;
240f7cc78ecSespie      asection *input_section ATTRIBUTE_UNUSED;
241f7cc78ecSespie      bfd *output_bfd;
242f7cc78ecSespie      char **error_message ATTRIBUTE_UNUSED;
243f7cc78ecSespie {
244f7cc78ecSespie   bfd_vma relocation;
245f7cc78ecSespie 
246f7cc78ecSespie   /* Make sure that the symbol's section is defined.  */
247f7cc78ecSespie   if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
248f7cc78ecSespie     return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
249f7cc78ecSespie   /* Get the size of the input section and turn it into the TMS320C30
250f7cc78ecSespie      32-bit address format.  */
251f7cc78ecSespie   relocation = (symbol->section->vma >> 2);
252f7cc78ecSespie   relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address);
253f7cc78ecSespie   bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
254f7cc78ecSespie   return bfd_reloc_ok;
255f7cc78ecSespie }
256f7cc78ecSespie 
257f7cc78ecSespie /* This function does the same thing as tic30_aout_fix_16 except for 32
258f7cc78ecSespie    bit relocations.  */
259f7cc78ecSespie 
260f7cc78ecSespie static bfd_reloc_status_type
tic30_aout_fix_32(abfd,reloc_entry,symbol,data,input_section,output_bfd,error_message)261f7cc78ecSespie tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section,
262f7cc78ecSespie 		   output_bfd, error_message)
263f7cc78ecSespie      bfd *abfd;
264f7cc78ecSespie      arelent *reloc_entry;
265f7cc78ecSespie      asymbol *symbol;
266f7cc78ecSespie      PTR data;
267f7cc78ecSespie      asection *input_section ATTRIBUTE_UNUSED;
268f7cc78ecSespie      bfd *output_bfd;
269f7cc78ecSespie      char **error_message ATTRIBUTE_UNUSED;
270f7cc78ecSespie {
271f7cc78ecSespie   bfd_vma relocation;
272f7cc78ecSespie 
273f7cc78ecSespie   /* Make sure that the symbol's section is defined.  */
274f7cc78ecSespie   if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
275f7cc78ecSespie     return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
276f7cc78ecSespie   /* Get the size of the input section and turn it into the TMS320C30
277f7cc78ecSespie      32-bit address format.  */
278f7cc78ecSespie   relocation = (symbol->section->vma >> 2);
279f7cc78ecSespie   relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address);
280f7cc78ecSespie   bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
281f7cc78ecSespie   return bfd_reloc_ok;
282f7cc78ecSespie }
283f7cc78ecSespie 
284f7cc78ecSespie /* This function is used to work out pc-relative offsets for the
285f7cc78ecSespie    TMS320C30.  The data already placed by md_pcrel_from within gas is
286f7cc78ecSespie    useless for a relocation, so we just get the offset value and place
287f7cc78ecSespie    a version of this within the object code.
288f7cc78ecSespie    tic30_aout_final_link_relocate will then calculate the required
289f7cc78ecSespie    relocation to add on to the value in the object code.  */
290f7cc78ecSespie 
291f7cc78ecSespie static bfd_reloc_status_type
tic30_aout_fix_pcrel_16(abfd,reloc_entry,symbol,data,input_section,output_bfd,error_message)292f7cc78ecSespie tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section,
293f7cc78ecSespie 			 output_bfd, error_message)
294f7cc78ecSespie      bfd *abfd;
295f7cc78ecSespie      arelent *reloc_entry;
296f7cc78ecSespie      asymbol *symbol ATTRIBUTE_UNUSED;
297f7cc78ecSespie      PTR data;
298f7cc78ecSespie      asection *input_section ATTRIBUTE_UNUSED;
299f7cc78ecSespie      bfd *output_bfd ATTRIBUTE_UNUSED;
300f7cc78ecSespie      char **error_message ATTRIBUTE_UNUSED;
301f7cc78ecSespie {
302f7cc78ecSespie   bfd_vma relocation = 1;
303f7cc78ecSespie   bfd_byte offset_data = bfd_get_8 (abfd, (bfd_byte *) data + reloc_entry->address - 1);
304f7cc78ecSespie 
305f7cc78ecSespie   /* The byte before the location of the fix contains bits 23-16 of
306f7cc78ecSespie      the pcrel instruction.  Bit 21 is set for a delayed instruction
307f7cc78ecSespie      which requires on offset of 3 instead of 1.  */
308f7cc78ecSespie   if (offset_data & 0x20)
309f7cc78ecSespie     relocation -= 3;
310f7cc78ecSespie   else
311f7cc78ecSespie     relocation -= 1;
312f7cc78ecSespie   bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address);
313f7cc78ecSespie   return bfd_reloc_ok;
314f7cc78ecSespie }
315f7cc78ecSespie 
316f7cc78ecSespie /* These macros will get 24-bit values from the bfd definition.
317f7cc78ecSespie    Big-endian only.  */
3185f210c2aSfgsch #define bfd_getb_24(BFD,ADDR)			\
3195f210c2aSfgsch  (bfd_get_8 (BFD, ADDR    ) << 16) |		\
320f7cc78ecSespie  (bfd_get_8 (BFD, ADDR + 1) <<  8) |		\
321f7cc78ecSespie  (bfd_get_8 (BFD, ADDR + 2)      )
322f7cc78ecSespie 
3235f210c2aSfgsch #define bfd_putb_24(BFD,DATA,ADDR)				\
3245f210c2aSfgsch  bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR    );	\
325f7cc78ecSespie  bfd_put_8 (BFD, (bfd_byte) ((DATA >>  8) & 0xFF), ADDR + 1);	\
326f7cc78ecSespie  bfd_put_8 (BFD, (bfd_byte) ( DATA        & 0xFF), ADDR + 2)
327f7cc78ecSespie 
328f7cc78ecSespie /* Set parameters about this a.out file that are machine-dependent.
329f7cc78ecSespie    This routine is called from some_aout_object_p just before it returns.  */
330f7cc78ecSespie 
331f7cc78ecSespie static const bfd_target *
tic30_aout_callback(abfd)332f7cc78ecSespie tic30_aout_callback (abfd)
333f7cc78ecSespie      bfd *abfd;
334f7cc78ecSespie {
335f7cc78ecSespie   struct internal_exec *execp = exec_hdr (abfd);
336f7cc78ecSespie   unsigned int arch_align_power;
337f7cc78ecSespie   unsigned long arch_align;
338f7cc78ecSespie 
339d2201f2fSdrahn   /* Calculate the file positions of the parts of a newly read aout header.  */
340f7cc78ecSespie   obj_textsec (abfd)->_raw_size = N_TXTSIZE (*execp);
341f7cc78ecSespie 
342d2201f2fSdrahn   /* The virtual memory addresses of the sections.  */
343f7cc78ecSespie   obj_textsec (abfd)->vma = N_TXTADDR (*execp);
344f7cc78ecSespie   obj_datasec (abfd)->vma = N_DATADDR (*execp);
345f7cc78ecSespie   obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
346f7cc78ecSespie 
347f7cc78ecSespie   obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
348f7cc78ecSespie   obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
349f7cc78ecSespie   obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
350f7cc78ecSespie 
351d2201f2fSdrahn   /* The file offsets of the sections.  */
352f7cc78ecSespie   obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
353f7cc78ecSespie   obj_datasec (abfd)->filepos = N_DATOFF (*execp);
354f7cc78ecSespie 
355d2201f2fSdrahn   /* The file offsets of the relocation info.  */
356f7cc78ecSespie   obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
357f7cc78ecSespie   obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
358f7cc78ecSespie 
359f7cc78ecSespie   /* The file offsets of the string table and symbol table.  */
360f7cc78ecSespie   obj_sym_filepos (abfd) = N_SYMOFF (*execp);
361f7cc78ecSespie   obj_str_filepos (abfd) = N_STROFF (*execp);
362f7cc78ecSespie 
363f7cc78ecSespie   /* Determine the architecture and machine type of the object file.  */
364f7cc78ecSespie #ifdef SET_ARCH_MACH
365f7cc78ecSespie   SET_ARCH_MACH (abfd, *execp);
366f7cc78ecSespie #else
367d2201f2fSdrahn   bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L);
368f7cc78ecSespie #endif
369f7cc78ecSespie 
370f7cc78ecSespie   /* Now that we know the architecture, set the alignments of the
371f7cc78ecSespie      sections.  This is normally done by NAME(aout,new_section_hook),
372f7cc78ecSespie      but when the initial sections were created the architecture had
373f7cc78ecSespie      not yet been set.  However, for backward compatibility, we don't
374f7cc78ecSespie      set the alignment power any higher than as required by the size
375f7cc78ecSespie      of the section.  */
376f7cc78ecSespie   arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
377f7cc78ecSespie   arch_align = 1 << arch_align_power;
378f7cc78ecSespie   if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
379f7cc78ecSespie        == obj_textsec (abfd)->_raw_size)
380f7cc78ecSespie       && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
381f7cc78ecSespie 	  == obj_datasec (abfd)->_raw_size)
382f7cc78ecSespie       && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
383f7cc78ecSespie 	  == obj_bsssec (abfd)->_raw_size))
384f7cc78ecSespie     {
385f7cc78ecSespie       obj_textsec (abfd)->alignment_power = arch_align_power;
386f7cc78ecSespie       obj_datasec (abfd)->alignment_power = arch_align_power;
387f7cc78ecSespie       obj_bsssec (abfd)->alignment_power = arch_align_power;
388f7cc78ecSespie     }
389f7cc78ecSespie   return abfd->xvec;
390f7cc78ecSespie }
391f7cc78ecSespie 
392f7cc78ecSespie static bfd_reloc_status_type
tic30_aout_final_link_relocate(howto,input_bfd,input_section,contents,address,value,addend)393f7cc78ecSespie tic30_aout_final_link_relocate (howto, input_bfd, input_section, contents,
394f7cc78ecSespie 				address, value, addend)
395f7cc78ecSespie      reloc_howto_type *howto;
396f7cc78ecSespie      bfd *input_bfd;
397f7cc78ecSespie      asection *input_section;
398f7cc78ecSespie      bfd_byte *contents;
399f7cc78ecSespie      bfd_vma address;
400f7cc78ecSespie      bfd_vma value;
401f7cc78ecSespie      bfd_vma addend;
402f7cc78ecSespie {
403f7cc78ecSespie   bfd_vma relocation;
404f7cc78ecSespie 
405f7cc78ecSespie   if (address > input_section->_raw_size)
406f7cc78ecSespie     return bfd_reloc_outofrange;
407f7cc78ecSespie 
408f7cc78ecSespie   relocation = value + addend;
409f7cc78ecSespie   if (howto->pc_relative)
410f7cc78ecSespie     {
411f7cc78ecSespie       relocation -= (input_section->output_section->vma + input_section->output_offset);
412f7cc78ecSespie       if (howto->pcrel_offset)
413f7cc78ecSespie 	relocation -= address;
414f7cc78ecSespie     }
415f7cc78ecSespie   return tic30_aout_relocate_contents (howto, input_bfd, relocation,
416f7cc78ecSespie 				       contents + address);
417f7cc78ecSespie }
418f7cc78ecSespie 
419f7cc78ecSespie bfd_reloc_status_type
tic30_aout_relocate_contents(howto,input_bfd,relocation,location)420f7cc78ecSespie tic30_aout_relocate_contents (howto, input_bfd, relocation, location)
421f7cc78ecSespie      reloc_howto_type *howto;
422f7cc78ecSespie      bfd *input_bfd;
423f7cc78ecSespie      bfd_vma relocation;
424f7cc78ecSespie      bfd_byte *location;
425f7cc78ecSespie {
426f7cc78ecSespie   bfd_vma x;
427d2201f2fSdrahn   bfd_boolean overflow;
428f7cc78ecSespie 
429f7cc78ecSespie   if (howto->size < 0)
430f7cc78ecSespie     relocation = -relocation;
431f7cc78ecSespie 
432f7cc78ecSespie   switch (howto->size)
433f7cc78ecSespie     {
434f7cc78ecSespie     default:
435f7cc78ecSespie     case 0:
436f7cc78ecSespie       abort ();
437f7cc78ecSespie       break;
438f7cc78ecSespie     case 1:
439f7cc78ecSespie       x = bfd_get_16 (input_bfd, location);
440f7cc78ecSespie       break;
441f7cc78ecSespie     case 2:
442f7cc78ecSespie       x = bfd_getb_24 (input_bfd, location);
443f7cc78ecSespie       break;
444f7cc78ecSespie     case 3:
445f7cc78ecSespie       x = bfd_get_8 (input_bfd, location);
446f7cc78ecSespie       break;
447f7cc78ecSespie     case 4:
448f7cc78ecSespie       x = bfd_get_32 (input_bfd, location);
449f7cc78ecSespie       break;
450f7cc78ecSespie     }
451d2201f2fSdrahn 
452d2201f2fSdrahn   overflow = FALSE;
453d2201f2fSdrahn 
454f7cc78ecSespie   if (howto->complain_on_overflow != complain_overflow_dont)
455f7cc78ecSespie     {
456f7cc78ecSespie       bfd_vma check;
457f7cc78ecSespie       bfd_signed_vma signed_check;
458f7cc78ecSespie       bfd_vma add;
459f7cc78ecSespie       bfd_signed_vma signed_add;
460f7cc78ecSespie 
461f7cc78ecSespie       if (howto->rightshift == 0)
462f7cc78ecSespie 	{
463f7cc78ecSespie 	  check = relocation;
464f7cc78ecSespie 	  signed_check = (bfd_signed_vma) relocation;
465f7cc78ecSespie 	}
466f7cc78ecSespie       else
467f7cc78ecSespie 	{
468f7cc78ecSespie 	  check = relocation >> howto->rightshift;
469f7cc78ecSespie 	  if ((bfd_signed_vma) relocation >= 0)
470f7cc78ecSespie 	    signed_check = check;
471f7cc78ecSespie 	  else
472f7cc78ecSespie 	    signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift)));
473f7cc78ecSespie 	}
474f7cc78ecSespie       add = x & howto->src_mask;
475f7cc78ecSespie       signed_add = add;
476f7cc78ecSespie       if ((add & (((~howto->src_mask) >> 1) & howto->src_mask)) != 0)
477f7cc78ecSespie 	signed_add -= (((~howto->src_mask) >> 1) & howto->src_mask) << 1;
478f7cc78ecSespie       if (howto->bitpos == 0)
479f7cc78ecSespie 	{
480f7cc78ecSespie 	  check += add;
481f7cc78ecSespie 	  signed_check += signed_add;
482f7cc78ecSespie 	}
483f7cc78ecSespie       else
484f7cc78ecSespie 	{
485f7cc78ecSespie 	  check += add >> howto->bitpos;
486f7cc78ecSespie 	  if (signed_add >= 0)
487f7cc78ecSespie 	    signed_check += add >> howto->bitpos;
488f7cc78ecSespie 	  else
489f7cc78ecSespie 	    signed_check += ((add >> howto->bitpos) | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->bitpos)));
490f7cc78ecSespie 	}
491f7cc78ecSespie       switch (howto->complain_on_overflow)
492f7cc78ecSespie 	{
493f7cc78ecSespie 	case complain_overflow_signed:
494f7cc78ecSespie 	  {
495f7cc78ecSespie 	    bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1;
496f7cc78ecSespie 	    bfd_signed_vma reloc_signed_min = ~reloc_signed_max;
497f7cc78ecSespie 	    if (signed_check > reloc_signed_max || signed_check < reloc_signed_min)
498d2201f2fSdrahn 	      overflow = TRUE;
499f7cc78ecSespie 	  }
500f7cc78ecSespie 	  break;
501f7cc78ecSespie 	case complain_overflow_unsigned:
502f7cc78ecSespie 	  {
503f7cc78ecSespie 	    bfd_vma reloc_unsigned_max = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
504f7cc78ecSespie 	    if (check > reloc_unsigned_max)
505d2201f2fSdrahn 	      overflow = TRUE;
506f7cc78ecSespie 	  }
507f7cc78ecSespie 	  break;
508f7cc78ecSespie 	case complain_overflow_bitfield:
509f7cc78ecSespie 	  {
510f7cc78ecSespie 	    bfd_vma reloc_bits = (((1 << (howto->bitsize - 1)) - 1) << 1) | 1;
511d2201f2fSdrahn 	    if ((check & ~reloc_bits) != 0
512d2201f2fSdrahn 		&& (((bfd_vma) signed_check & ~reloc_bits)
513d2201f2fSdrahn 		    != ((bfd_vma) -1 & ~reloc_bits)))
514d2201f2fSdrahn 	      overflow = TRUE;
515f7cc78ecSespie 	  }
516f7cc78ecSespie 	  break;
517f7cc78ecSespie 	default:
518f7cc78ecSespie 	  abort ();
519f7cc78ecSespie 	}
520f7cc78ecSespie     }
521f7cc78ecSespie   relocation >>= (bfd_vma) howto->rightshift;
522f7cc78ecSespie   relocation <<= (bfd_vma) howto->bitpos;
523f7cc78ecSespie   x = ((x & ~howto->dst_mask) | (((x & howto->src_mask) + relocation) & howto->dst_mask));
524f7cc78ecSespie   switch (howto->size)
525f7cc78ecSespie     {
526f7cc78ecSespie     default:
527f7cc78ecSespie     case 0:
528f7cc78ecSespie       abort ();
529f7cc78ecSespie       break;
530f7cc78ecSespie     case 1:
531f7cc78ecSespie       bfd_put_16 (input_bfd, x, location);
532f7cc78ecSespie       break;
533f7cc78ecSespie     case 2:
534f7cc78ecSespie       bfd_putb_24 (input_bfd, x, location);
535f7cc78ecSespie       break;
536f7cc78ecSespie     case 3:
537f7cc78ecSespie       bfd_put_8 (input_bfd, x, location);
538f7cc78ecSespie       break;
539f7cc78ecSespie     case 4:
540f7cc78ecSespie       bfd_put_32 (input_bfd, x, location);
541f7cc78ecSespie       break;
542f7cc78ecSespie     }
543f7cc78ecSespie   return overflow ? bfd_reloc_overflow : bfd_reloc_ok;
544f7cc78ecSespie }
545f7cc78ecSespie 
546d2201f2fSdrahn /* Finish up the reading of an a.out file header.  */
547f7cc78ecSespie 
548f7cc78ecSespie static const bfd_target *
tic30_aout_object_p(abfd)549f7cc78ecSespie tic30_aout_object_p (abfd)
550f7cc78ecSespie      bfd *abfd;
551f7cc78ecSespie {
552d2201f2fSdrahn   struct external_exec exec_bytes;	/* Raw exec header from file.  */
553d2201f2fSdrahn   struct internal_exec exec;	/* Cleaned-up exec header.  */
554f7cc78ecSespie   const bfd_target *target;
555d2201f2fSdrahn   bfd_size_type amt = EXEC_BYTES_SIZE;
556f7cc78ecSespie 
557d2201f2fSdrahn   if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt)
558f7cc78ecSespie     {
559f7cc78ecSespie       if (bfd_get_error () != bfd_error_system_call)
560f7cc78ecSespie 	bfd_set_error (bfd_error_wrong_format);
561f7cc78ecSespie       return 0;
562f7cc78ecSespie     }
563f7cc78ecSespie 
564f7cc78ecSespie #ifdef SWAP_MAGIC
565f7cc78ecSespie   exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
566f7cc78ecSespie #else
567d2201f2fSdrahn   exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
568f7cc78ecSespie #endif /* SWAP_MAGIC */
569f7cc78ecSespie 
570f7cc78ecSespie   if (N_BADMAG (exec))
571f7cc78ecSespie     return 0;
572f7cc78ecSespie #ifdef MACHTYPE_OK
573f7cc78ecSespie   if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
574f7cc78ecSespie     return 0;
575f7cc78ecSespie #endif
576f7cc78ecSespie 
577f7cc78ecSespie   NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
578f7cc78ecSespie 
579f7cc78ecSespie #ifdef SWAP_MAGIC
580f7cc78ecSespie   /* swap_exec_header_in read in a_info with the wrong byte order */
581f7cc78ecSespie   exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
582f7cc78ecSespie #endif /* SWAP_MAGIC */
583f7cc78ecSespie 
584f7cc78ecSespie   target = NAME (aout, some_aout_object_p) (abfd, &exec, tic30_aout_callback);
585f7cc78ecSespie 
586f7cc78ecSespie #ifdef ENTRY_CAN_BE_ZERO
587f7cc78ecSespie   /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
588d2201f2fSdrahn      means that it isn't obvious if EXEC_P should be set.
589d2201f2fSdrahn      All of the following must be true for an executable:
590d2201f2fSdrahn      There must be no relocations, the bfd can be neither an
591d2201f2fSdrahn      archive nor an archive element, and the file must be executable.  */
592f7cc78ecSespie 
593f7cc78ecSespie   if (exec.a_trsize + exec.a_drsize == 0
594f7cc78ecSespie       && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL)
595f7cc78ecSespie     {
596f7cc78ecSespie       struct stat buf;
597f7cc78ecSespie #ifndef S_IXUSR
598f7cc78ecSespie #define S_IXUSR 0100		/* Execute by owner.  */
599f7cc78ecSespie #endif
600f7cc78ecSespie       if (stat (abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
601f7cc78ecSespie 	abfd->flags |= EXEC_P;
602f7cc78ecSespie     }
603f7cc78ecSespie #endif /* ENTRY_CAN_BE_ZERO */
604f7cc78ecSespie 
605f7cc78ecSespie   return target;
606f7cc78ecSespie }
607f7cc78ecSespie 
608f7cc78ecSespie /* Copy private section data.  This actually does nothing with the
609f7cc78ecSespie    sections.  It copies the subformat field.  We copy it here, because
610f7cc78ecSespie    we need to know whether this is a QMAGIC file before we set the
611f7cc78ecSespie    section contents, and copy_private_bfd_data is not called until
612f7cc78ecSespie    after the section contents have been set.  */
613f7cc78ecSespie 
614d2201f2fSdrahn static bfd_boolean
MY_bfd_copy_private_section_data(ibfd,isec,obfd,osec)615f7cc78ecSespie MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
616f7cc78ecSespie      bfd *ibfd;
617f7cc78ecSespie      asection *isec ATTRIBUTE_UNUSED;
618f7cc78ecSespie      bfd *obfd;
619f7cc78ecSespie      asection *osec ATTRIBUTE_UNUSED;
620f7cc78ecSespie {
621f7cc78ecSespie   if (bfd_get_flavour (obfd) == bfd_target_aout_flavour)
622f7cc78ecSespie     obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
623d2201f2fSdrahn   return TRUE;
624f7cc78ecSespie }
625f7cc78ecSespie 
626f7cc78ecSespie /* Write an object file.
627f7cc78ecSespie    Section contents have already been written.  We write the
628f7cc78ecSespie    file header, symbols, and relocation.  */
629f7cc78ecSespie 
630d2201f2fSdrahn static bfd_boolean
tic30_aout_write_object_contents(abfd)631f7cc78ecSespie tic30_aout_write_object_contents (abfd)
632f7cc78ecSespie      bfd *abfd;
633f7cc78ecSespie {
634f7cc78ecSespie   struct external_exec exec_bytes;
635f7cc78ecSespie   struct internal_exec *execp = exec_hdr (abfd);
636f7cc78ecSespie 
637f7cc78ecSespie   obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
638f7cc78ecSespie 
639f7cc78ecSespie   {
640d2201f2fSdrahn     bfd_size_type text_size;	/* Dummy vars.  */
641f7cc78ecSespie     file_ptr text_end;
642d2201f2fSdrahn 
643f7cc78ecSespie     if (adata (abfd).magic == undecided_magic)
644f7cc78ecSespie       NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
645f7cc78ecSespie 
646f7cc78ecSespie     execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
647f7cc78ecSespie     execp->a_entry = bfd_get_start_address (abfd);
648f7cc78ecSespie 
649f7cc78ecSespie     execp->a_trsize = ((obj_textsec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
650f7cc78ecSespie     execp->a_drsize = ((obj_datasec (abfd)->reloc_count) * obj_reloc_entry_size (abfd));
651f7cc78ecSespie     NAME (aout, swap_exec_header_out) (abfd, execp, &exec_bytes);
652f7cc78ecSespie 
653f7cc78ecSespie     if (adata (abfd).exec_bytes_size > 0)
654f7cc78ecSespie       {
655d2201f2fSdrahn 	bfd_size_type amt;
656f7cc78ecSespie 	if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0)
657d2201f2fSdrahn 	  return FALSE;
658d2201f2fSdrahn 	amt = adata (abfd).exec_bytes_size;
659d2201f2fSdrahn 	if (bfd_bwrite ((PTR) &exec_bytes, amt, abfd) != amt)
660d2201f2fSdrahn 	  return FALSE;
661f7cc78ecSespie       }
662f7cc78ecSespie 
663d2201f2fSdrahn     /* Now write out reloc info, followed by syms and strings.  */
664f7cc78ecSespie     if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
665f7cc78ecSespie 	&& bfd_get_symcount (abfd) != 0)
666f7cc78ecSespie       {
667f7cc78ecSespie 	if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
668d2201f2fSdrahn 	  return FALSE;
669f7cc78ecSespie 
670f7cc78ecSespie 	if (!NAME (aout, write_syms) (abfd))
671d2201f2fSdrahn 	  return FALSE;
672f7cc78ecSespie       }
673f7cc78ecSespie 
674f7cc78ecSespie     if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
675d2201f2fSdrahn       return FALSE;
676f7cc78ecSespie     if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
677d2201f2fSdrahn       return FALSE;
678f7cc78ecSespie 
679f7cc78ecSespie     if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
680d2201f2fSdrahn       return FALSE;
681f7cc78ecSespie     if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
682d2201f2fSdrahn       return FALSE;
683f7cc78ecSespie   }
684f7cc78ecSespie 
685d2201f2fSdrahn   return TRUE;
686f7cc78ecSespie }
687f7cc78ecSespie 
688d2201f2fSdrahn static bfd_boolean
tic30_aout_set_sizes(abfd)689f7cc78ecSespie tic30_aout_set_sizes (abfd)
690f7cc78ecSespie      bfd *abfd;
691f7cc78ecSespie {
692f7cc78ecSespie   adata (abfd).page_size = TARGET_PAGE_SIZE;
693f7cc78ecSespie 
694f7cc78ecSespie #ifdef SEGMENT_SIZE
695f7cc78ecSespie   adata (abfd).segment_size = SEGMENT_SIZE;
696f7cc78ecSespie #else
697f7cc78ecSespie   adata (abfd).segment_size = TARGET_PAGE_SIZE;
698f7cc78ecSespie #endif
699f7cc78ecSespie 
700f7cc78ecSespie #ifdef ZMAGIC_DISK_BLOCK_SIZE
701f7cc78ecSespie   adata (abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
702f7cc78ecSespie #else
703f7cc78ecSespie   adata (abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
704f7cc78ecSespie #endif
705f7cc78ecSespie 
706f7cc78ecSespie   adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE;
707f7cc78ecSespie 
708d2201f2fSdrahn   return TRUE;
709f7cc78ecSespie }
710f7cc78ecSespie 
711f7cc78ecSespie #ifndef MY_final_link_callback
712f7cc78ecSespie 
713f7cc78ecSespie /* Callback for the final_link routine to set the section offsets.  */
714f7cc78ecSespie 
715f7cc78ecSespie static void MY_final_link_callback
716f7cc78ecSespie   PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
717f7cc78ecSespie 
718f7cc78ecSespie static void
MY_final_link_callback(abfd,ptreloff,pdreloff,psymoff)719f7cc78ecSespie MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
720f7cc78ecSespie      bfd *abfd;
721f7cc78ecSespie      file_ptr *ptreloff;
722f7cc78ecSespie      file_ptr *pdreloff;
723f7cc78ecSespie      file_ptr *psymoff;
724f7cc78ecSespie {
725f7cc78ecSespie   struct internal_exec *execp = exec_hdr (abfd);
726f7cc78ecSespie 
727f7cc78ecSespie   *ptreloff = obj_datasec (abfd)->filepos + execp->a_data;
728f7cc78ecSespie   *pdreloff = *ptreloff + execp->a_trsize;
729f7cc78ecSespie   *psymoff = *pdreloff + execp->a_drsize;;
730f7cc78ecSespie }
731f7cc78ecSespie 
732f7cc78ecSespie #endif
733f7cc78ecSespie 
734f7cc78ecSespie #ifndef MY_bfd_final_link
735f7cc78ecSespie 
736f7cc78ecSespie /* Final link routine.  We need to use a call back to get the correct
737f7cc78ecSespie    offsets in the output file.  */
738f7cc78ecSespie 
739d2201f2fSdrahn static bfd_boolean
MY_bfd_final_link(abfd,info)740f7cc78ecSespie MY_bfd_final_link (abfd, info)
741f7cc78ecSespie      bfd *abfd;
742f7cc78ecSespie      struct bfd_link_info *info;
743f7cc78ecSespie {
744f7cc78ecSespie   struct internal_exec *execp = exec_hdr (abfd);
745f7cc78ecSespie   file_ptr pos;
746f7cc78ecSespie   bfd_vma vma = 0;
747f7cc78ecSespie   int pad;
748f7cc78ecSespie 
749f7cc78ecSespie   /* Set the executable header size to 0, as we don't want one for an
750f7cc78ecSespie      output.  */
751f7cc78ecSespie   adata (abfd).exec_bytes_size = 0;
752f7cc78ecSespie   pos = adata (abfd).exec_bytes_size;
753f7cc78ecSespie   /* Text.  */
754f7cc78ecSespie   vma = info->create_object_symbols_section->vma;
755f7cc78ecSespie   pos += vma;
756f7cc78ecSespie   obj_textsec (abfd)->filepos = pos;
757f7cc78ecSespie   obj_textsec (abfd)->vma = vma;
758f7cc78ecSespie   obj_textsec (abfd)->user_set_vma = 1;
759f7cc78ecSespie   pos += obj_textsec (abfd)->_raw_size;
760f7cc78ecSespie   vma += obj_textsec (abfd)->_raw_size;
761f7cc78ecSespie 
762f7cc78ecSespie   /* Data.  */
763f7cc78ecSespie   if (abfd->flags & D_PAGED)
764f7cc78ecSespie     {
765f7cc78ecSespie       if (info->create_object_symbols_section->next->vma > 0)
766f7cc78ecSespie 	obj_datasec (abfd)->vma = info->create_object_symbols_section->next->vma;
767f7cc78ecSespie       else
768f7cc78ecSespie 	obj_datasec (abfd)->vma = BFD_ALIGN (vma, adata (abfd).segment_size);
769f7cc78ecSespie     }
770f7cc78ecSespie   else
771f7cc78ecSespie     {
772f7cc78ecSespie       obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
773f7cc78ecSespie     }
774d2201f2fSdrahn 
775f7cc78ecSespie   if (obj_datasec (abfd)->vma < vma)
776f7cc78ecSespie     obj_datasec (abfd)->vma = BFD_ALIGN (vma, 4);
777d2201f2fSdrahn 
778f7cc78ecSespie   obj_datasec (abfd)->user_set_vma = 1;
779f7cc78ecSespie   vma = obj_datasec (abfd)->vma;
780f7cc78ecSespie   obj_datasec (abfd)->filepos = vma + adata (abfd).exec_bytes_size;
781f7cc78ecSespie   execp->a_text = vma - obj_textsec (abfd)->vma;
782f7cc78ecSespie   obj_textsec (abfd)->_raw_size = execp->a_text;
783f7cc78ecSespie 
784f7cc78ecSespie   /* Since BSS follows data immediately, see if it needs alignment.  */
785f7cc78ecSespie   vma += obj_datasec (abfd)->_raw_size;
786f7cc78ecSespie   pad = align_power (vma, obj_bsssec (abfd)->alignment_power) - vma;
787f7cc78ecSespie   obj_datasec (abfd)->_raw_size += pad;
788f7cc78ecSespie   pos += obj_datasec (abfd)->_raw_size;
789f7cc78ecSespie   execp->a_data = obj_datasec (abfd)->_raw_size;
790f7cc78ecSespie 
791f7cc78ecSespie   /* BSS.  */
792f7cc78ecSespie   obj_bsssec (abfd)->vma = vma;
793f7cc78ecSespie   obj_bsssec (abfd)->user_set_vma = 1;
794f7cc78ecSespie 
795f7cc78ecSespie   /* We are fully resized, so don't readjust in final_link.  */
796f7cc78ecSespie   adata (abfd).magic = z_magic;
797f7cc78ecSespie 
798f7cc78ecSespie   return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
799f7cc78ecSespie }
800f7cc78ecSespie 
801f7cc78ecSespie #endif
802f7cc78ecSespie 
803f7cc78ecSespie enum machine_type
tic30_aout_machine_type(arch,machine,unknown)804f7cc78ecSespie tic30_aout_machine_type (arch, machine, unknown)
805f7cc78ecSespie      enum bfd_architecture arch;
806f7cc78ecSespie      unsigned long machine ATTRIBUTE_UNUSED;
807d2201f2fSdrahn      bfd_boolean *unknown;
808f7cc78ecSespie {
809f7cc78ecSespie   enum machine_type arch_flags;
810f7cc78ecSespie 
811f7cc78ecSespie   arch_flags = M_UNKNOWN;
812d2201f2fSdrahn   *unknown = TRUE;
813f7cc78ecSespie 
814f7cc78ecSespie   switch (arch)
815f7cc78ecSespie     {
816f7cc78ecSespie     case bfd_arch_tic30:
817d2201f2fSdrahn       *unknown = FALSE;
818f7cc78ecSespie       break;
819f7cc78ecSespie     default:
820f7cc78ecSespie       arch_flags = M_UNKNOWN;
821f7cc78ecSespie     }
822f7cc78ecSespie   if (arch_flags != M_UNKNOWN)
823d2201f2fSdrahn     *unknown = FALSE;
824f7cc78ecSespie   return arch_flags;
825f7cc78ecSespie }
826f7cc78ecSespie 
827d2201f2fSdrahn bfd_boolean
tic30_aout_set_arch_mach(abfd,arch,machine)828f7cc78ecSespie tic30_aout_set_arch_mach (abfd, arch, machine)
829f7cc78ecSespie      bfd *abfd;
830f7cc78ecSespie      enum bfd_architecture arch;
831f7cc78ecSespie      unsigned long machine;
832f7cc78ecSespie {
833f7cc78ecSespie   if (!bfd_default_set_arch_mach (abfd, arch, machine))
834d2201f2fSdrahn     return FALSE;
835f7cc78ecSespie   if (arch != bfd_arch_unknown)
836f7cc78ecSespie     {
837d2201f2fSdrahn       bfd_boolean unknown;
838f7cc78ecSespie       tic30_aout_machine_type (arch, machine, &unknown);
839f7cc78ecSespie       if (unknown)
840d2201f2fSdrahn 	return FALSE;
841f7cc78ecSespie     }
842f7cc78ecSespie   obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
843f7cc78ecSespie   return (*aout_backend_info (abfd)->set_sizes) (abfd);
844f7cc78ecSespie }
845f7cc78ecSespie 
846f7cc78ecSespie /* We assume BFD generic archive files.  */
847f7cc78ecSespie #ifndef	MY_openr_next_archived_file
848f7cc78ecSespie #define	MY_openr_next_archived_file	bfd_generic_openr_next_archived_file
849f7cc78ecSespie #endif
850f7cc78ecSespie #ifndef MY_get_elt_at_index
851f7cc78ecSespie #define MY_get_elt_at_index		_bfd_generic_get_elt_at_index
852f7cc78ecSespie #endif
853f7cc78ecSespie #ifndef	MY_generic_stat_arch_elt
854f7cc78ecSespie #define	MY_generic_stat_arch_elt	bfd_generic_stat_arch_elt
855f7cc78ecSespie #endif
856f7cc78ecSespie #ifndef	MY_slurp_armap
857f7cc78ecSespie #define	MY_slurp_armap			bfd_slurp_bsd_armap
858f7cc78ecSespie #endif
859f7cc78ecSespie #ifndef	MY_slurp_extended_name_table
860f7cc78ecSespie #define	MY_slurp_extended_name_table	_bfd_slurp_extended_name_table
861f7cc78ecSespie #endif
862f7cc78ecSespie #ifndef MY_construct_extended_name_table
863f7cc78ecSespie #define MY_construct_extended_name_table \
864f7cc78ecSespie   _bfd_archive_bsd_construct_extended_name_table
865f7cc78ecSespie #endif
866f7cc78ecSespie #ifndef	MY_write_armap
867f7cc78ecSespie #define	MY_write_armap		bsd_write_armap
868f7cc78ecSespie #endif
869f7cc78ecSespie #ifndef MY_read_ar_hdr
870f7cc78ecSespie #define MY_read_ar_hdr		_bfd_generic_read_ar_hdr
871f7cc78ecSespie #endif
872f7cc78ecSespie #ifndef	MY_truncate_arname
873f7cc78ecSespie #define	MY_truncate_arname		bfd_bsd_truncate_arname
874f7cc78ecSespie #endif
875f7cc78ecSespie #ifndef MY_update_armap_timestamp
876f7cc78ecSespie #define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
877f7cc78ecSespie #endif
878f7cc78ecSespie 
879f7cc78ecSespie /* No core file defined here -- configure in trad-core.c separately.  */
880f7cc78ecSespie #ifndef	MY_core_file_failing_command
881f7cc78ecSespie #define	MY_core_file_failing_command _bfd_nocore_core_file_failing_command
882f7cc78ecSespie #endif
883f7cc78ecSespie #ifndef	MY_core_file_failing_signal
884f7cc78ecSespie #define	MY_core_file_failing_signal	_bfd_nocore_core_file_failing_signal
885f7cc78ecSespie #endif
886f7cc78ecSespie #ifndef	MY_core_file_matches_executable_p
887f7cc78ecSespie #define	MY_core_file_matches_executable_p	\
888f7cc78ecSespie 				_bfd_nocore_core_file_matches_executable_p
889f7cc78ecSespie #endif
890f7cc78ecSespie #ifndef	MY_core_file_p
891f7cc78ecSespie #define	MY_core_file_p		_bfd_dummy_target
892f7cc78ecSespie #endif
893f7cc78ecSespie 
894f7cc78ecSespie #ifndef MY_bfd_debug_info_start
895f7cc78ecSespie #define MY_bfd_debug_info_start		bfd_void
896f7cc78ecSespie #endif
897f7cc78ecSespie #ifndef MY_bfd_debug_info_end
898f7cc78ecSespie #define MY_bfd_debug_info_end		bfd_void
899f7cc78ecSespie #endif
900f7cc78ecSespie #ifndef MY_bfd_debug_info_accumulate
901f7cc78ecSespie #define MY_bfd_debug_info_accumulate	\
902*cf2f2c56Smiod 		(void (*) PARAMS ((bfd*, struct bfd_section *))) bfd_void
903f7cc78ecSespie #endif
904f7cc78ecSespie 
905f7cc78ecSespie #ifndef MY_core_file_failing_command
906f7cc78ecSespie #define MY_core_file_failing_command NAME(aout,core_file_failing_command)
907f7cc78ecSespie #endif
908f7cc78ecSespie #ifndef MY_core_file_failing_signal
909f7cc78ecSespie #define MY_core_file_failing_signal NAME(aout,core_file_failing_signal)
910f7cc78ecSespie #endif
911f7cc78ecSespie #ifndef MY_core_file_matches_executable_p
912f7cc78ecSespie #define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p)
913f7cc78ecSespie #endif
914f7cc78ecSespie #ifndef MY_set_section_contents
915f7cc78ecSespie #define MY_set_section_contents NAME(aout,set_section_contents)
916f7cc78ecSespie #endif
917f7cc78ecSespie #ifndef MY_get_section_contents
918f7cc78ecSespie #define MY_get_section_contents aout_32_get_section_contents
919f7cc78ecSespie #endif
920f7cc78ecSespie #ifndef MY_get_section_contents_in_window
921f7cc78ecSespie #define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
922f7cc78ecSespie #endif
923f7cc78ecSespie #ifndef MY_new_section_hook
924f7cc78ecSespie #define MY_new_section_hook NAME(aout,new_section_hook)
925f7cc78ecSespie #endif
926f7cc78ecSespie #ifndef MY_get_symtab_upper_bound
927f7cc78ecSespie #define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
928f7cc78ecSespie #endif
929*cf2f2c56Smiod #ifndef MY_canonicalize_symtab
930*cf2f2c56Smiod #define MY_canonicalize_symtab NAME(aout,canonicalize_symtab)
931f7cc78ecSespie #endif
932f7cc78ecSespie #ifndef MY_get_reloc_upper_bound
933f7cc78ecSespie #define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
934f7cc78ecSespie #endif
935f7cc78ecSespie #ifndef MY_canonicalize_reloc
936f7cc78ecSespie #define MY_canonicalize_reloc NAME(aout,canonicalize_reloc)
937f7cc78ecSespie #endif
938f7cc78ecSespie #ifndef MY_make_empty_symbol
939f7cc78ecSespie #define MY_make_empty_symbol NAME(aout,make_empty_symbol)
940f7cc78ecSespie #endif
941f7cc78ecSespie #ifndef MY_print_symbol
942f7cc78ecSespie #define MY_print_symbol NAME(aout,print_symbol)
943f7cc78ecSespie #endif
944f7cc78ecSespie #ifndef MY_get_symbol_info
945f7cc78ecSespie #define MY_get_symbol_info NAME(aout,get_symbol_info)
946f7cc78ecSespie #endif
947f7cc78ecSespie #ifndef MY_get_lineno
948f7cc78ecSespie #define MY_get_lineno NAME(aout,get_lineno)
949f7cc78ecSespie #endif
950f7cc78ecSespie #ifndef MY_set_arch_mach
951f7cc78ecSespie #define MY_set_arch_mach tic30_aout_set_arch_mach
952f7cc78ecSespie #endif
953f7cc78ecSespie #ifndef MY_find_nearest_line
954f7cc78ecSespie #define MY_find_nearest_line NAME(aout,find_nearest_line)
955f7cc78ecSespie #endif
956f7cc78ecSespie #ifndef MY_sizeof_headers
957f7cc78ecSespie #define MY_sizeof_headers NAME(aout,sizeof_headers)
958f7cc78ecSespie #endif
959f7cc78ecSespie #ifndef MY_bfd_get_relocated_section_contents
960f7cc78ecSespie #define MY_bfd_get_relocated_section_contents \
961f7cc78ecSespie 			bfd_generic_get_relocated_section_contents
962f7cc78ecSespie #endif
963f7cc78ecSespie #ifndef MY_bfd_relax_section
964f7cc78ecSespie #define MY_bfd_relax_section bfd_generic_relax_section
965f7cc78ecSespie #endif
966f7cc78ecSespie #ifndef MY_bfd_gc_sections
967f7cc78ecSespie #define MY_bfd_gc_sections bfd_generic_gc_sections
968f7cc78ecSespie #endif
969d2201f2fSdrahn #ifndef MY_bfd_merge_sections
970d2201f2fSdrahn #define MY_bfd_merge_sections bfd_generic_merge_sections
971d2201f2fSdrahn #endif
972d2201f2fSdrahn #ifndef MY_bfd_discard_group
973d2201f2fSdrahn #define MY_bfd_discard_group bfd_generic_discard_group
974d2201f2fSdrahn #endif
975f7cc78ecSespie #ifndef MY_bfd_reloc_type_lookup
976f7cc78ecSespie #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
977f7cc78ecSespie #endif
978f7cc78ecSespie #ifndef MY_bfd_make_debug_symbol
979f7cc78ecSespie #define MY_bfd_make_debug_symbol 0
980f7cc78ecSespie #endif
981f7cc78ecSespie #ifndef MY_read_minisymbols
982f7cc78ecSespie #define MY_read_minisymbols NAME(aout,read_minisymbols)
983f7cc78ecSespie #endif
984f7cc78ecSespie #ifndef MY_minisymbol_to_symbol
985f7cc78ecSespie #define MY_minisymbol_to_symbol NAME(aout,minisymbol_to_symbol)
986f7cc78ecSespie #endif
987f7cc78ecSespie #ifndef MY_bfd_link_hash_table_create
988f7cc78ecSespie #define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create)
989f7cc78ecSespie #endif
990d2201f2fSdrahn #ifndef MY_bfd_link_hash_table_free
991d2201f2fSdrahn #define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
992d2201f2fSdrahn #endif
993f7cc78ecSespie #ifndef MY_bfd_link_add_symbols
994f7cc78ecSespie #define MY_bfd_link_add_symbols NAME(aout,link_add_symbols)
995f7cc78ecSespie #endif
996d2201f2fSdrahn #ifndef MY_bfd_link_just_syms
997d2201f2fSdrahn #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
998d2201f2fSdrahn #endif
999f7cc78ecSespie #ifndef MY_bfd_link_split_section
1000f7cc78ecSespie #define MY_bfd_link_split_section  _bfd_generic_link_split_section
1001f7cc78ecSespie #endif
1002f7cc78ecSespie 
1003f7cc78ecSespie #ifndef MY_bfd_copy_private_bfd_data
1004f7cc78ecSespie #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
1005f7cc78ecSespie #endif
1006f7cc78ecSespie 
1007f7cc78ecSespie #ifndef MY_bfd_merge_private_bfd_data
1008f7cc78ecSespie #define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
1009f7cc78ecSespie #endif
1010f7cc78ecSespie 
1011f7cc78ecSespie #ifndef MY_bfd_copy_private_symbol_data
1012f7cc78ecSespie #define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
1013f7cc78ecSespie #endif
1014f7cc78ecSespie 
1015f7cc78ecSespie #ifndef MY_bfd_print_private_bfd_data
1016f7cc78ecSespie #define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
1017f7cc78ecSespie #endif
1018f7cc78ecSespie 
1019f7cc78ecSespie #ifndef MY_bfd_set_private_flags
1020f7cc78ecSespie #define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
1021f7cc78ecSespie #endif
1022f7cc78ecSespie 
1023f7cc78ecSespie #ifndef MY_bfd_is_local_label_name
1024f7cc78ecSespie #define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
1025f7cc78ecSespie #endif
1026f7cc78ecSespie 
1027f7cc78ecSespie #ifndef MY_bfd_free_cached_info
1028f7cc78ecSespie #define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
1029f7cc78ecSespie #endif
1030f7cc78ecSespie 
1031f7cc78ecSespie #ifndef MY_close_and_cleanup
1032f7cc78ecSespie #define MY_close_and_cleanup MY_bfd_free_cached_info
1033f7cc78ecSespie #endif
1034f7cc78ecSespie 
1035f7cc78ecSespie #ifndef MY_get_dynamic_symtab_upper_bound
1036f7cc78ecSespie #define MY_get_dynamic_symtab_upper_bound \
1037f7cc78ecSespie   _bfd_nodynamic_get_dynamic_symtab_upper_bound
1038f7cc78ecSespie #endif
1039f7cc78ecSespie #ifndef MY_canonicalize_dynamic_symtab
1040f7cc78ecSespie #define MY_canonicalize_dynamic_symtab \
1041f7cc78ecSespie   _bfd_nodynamic_canonicalize_dynamic_symtab
1042f7cc78ecSespie #endif
1043f7cc78ecSespie #ifndef MY_get_dynamic_reloc_upper_bound
1044f7cc78ecSespie #define MY_get_dynamic_reloc_upper_bound \
1045f7cc78ecSespie   _bfd_nodynamic_get_dynamic_reloc_upper_bound
1046f7cc78ecSespie #endif
1047f7cc78ecSespie #ifndef MY_canonicalize_dynamic_reloc
1048f7cc78ecSespie #define MY_canonicalize_dynamic_reloc \
1049f7cc78ecSespie   _bfd_nodynamic_canonicalize_dynamic_reloc
1050f7cc78ecSespie #endif
1051f7cc78ecSespie 
1052f7cc78ecSespie /* Aout symbols normally have leading underscores */
1053f7cc78ecSespie #ifndef MY_symbol_leading_char
1054f7cc78ecSespie #define MY_symbol_leading_char '_'
1055f7cc78ecSespie #endif
1056f7cc78ecSespie 
1057f7cc78ecSespie /* Aout archives normally use spaces for padding */
1058f7cc78ecSespie #ifndef AR_PAD_CHAR
1059f7cc78ecSespie #define AR_PAD_CHAR ' '
1060f7cc78ecSespie #endif
1061f7cc78ecSespie 
1062f7cc78ecSespie #ifndef MY_BFD_TARGET
1063f7cc78ecSespie const bfd_target tic30_aout_vec =
1064f7cc78ecSespie {
1065f7cc78ecSespie   TARGETNAME,			/* name */
1066f7cc78ecSespie   bfd_target_aout_flavour,
1067f7cc78ecSespie   BFD_ENDIAN_BIG,		/* target byte order (big) */
1068f7cc78ecSespie   BFD_ENDIAN_BIG,		/* target headers byte order (big) */
1069f7cc78ecSespie   (HAS_RELOC |			/* object flags */
1070f7cc78ecSespie    HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED),
1071f7cc78ecSespie   (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC),	/* section flags */
1072f7cc78ecSespie   MY_symbol_leading_char,
1073f7cc78ecSespie   AR_PAD_CHAR,			/* ar_pad_char */
1074f7cc78ecSespie   15,				/* ar_max_namelen */
1075f7cc78ecSespie   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1076f7cc78ecSespie   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1077f7cc78ecSespie   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* data */
1078f7cc78ecSespie   bfd_getb64, bfd_getb_signed_64, bfd_putb64,
1079f7cc78ecSespie   bfd_getb32, bfd_getb_signed_32, bfd_putb32,
1080f7cc78ecSespie   bfd_getb16, bfd_getb_signed_16, bfd_putb16,	/* hdrs */
1081f7cc78ecSespie   {_bfd_dummy_target, MY_object_p,	/* bfd_check_format */
1082f7cc78ecSespie    bfd_generic_archive_p, MY_core_file_p},
1083f7cc78ecSespie   {bfd_false, MY_mkobject,	/* bfd_set_format */
1084f7cc78ecSespie    _bfd_generic_mkarchive, bfd_false},
1085f7cc78ecSespie   {bfd_false, MY_write_object_contents,		/* bfd_write_contents */
1086f7cc78ecSespie    _bfd_write_archive_contents, bfd_false},
1087f7cc78ecSespie 
1088f7cc78ecSespie   BFD_JUMP_TABLE_GENERIC (MY),
1089f7cc78ecSespie   BFD_JUMP_TABLE_COPY (MY),
1090f7cc78ecSespie   BFD_JUMP_TABLE_CORE (MY),
1091f7cc78ecSespie   BFD_JUMP_TABLE_ARCHIVE (MY),
1092f7cc78ecSespie   BFD_JUMP_TABLE_SYMBOLS (MY),
1093f7cc78ecSespie   BFD_JUMP_TABLE_RELOCS (MY),
1094f7cc78ecSespie   BFD_JUMP_TABLE_WRITE (MY),
1095f7cc78ecSespie   BFD_JUMP_TABLE_LINK (MY),
1096f7cc78ecSespie   BFD_JUMP_TABLE_DYNAMIC (MY),
1097f7cc78ecSespie 
1098f7cc78ecSespie   NULL,
1099f7cc78ecSespie 
1100f7cc78ecSespie   (PTR) MY_backend_data
1101f7cc78ecSespie };
1102f7cc78ecSespie #endif /* MY_BFD_TARGET */
1103