OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [branches/] [oc/] [gdb-5.0/] [bfd/] [aout-target.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 104 markom
/* Define a target vector and some small routines for a variant of a.out.
2
   Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
3
   Free Software Foundation, Inc.
4
 
5
This file is part of BFD, the Binary File Descriptor library.
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
#include "aout/aout64.h"
22
#include "aout/stab_gnu.h"
23
#include "aout/ar.h"
24
/*#include "libaout.h"*/
25
 
26
#ifndef SEGMENT_SIZE
27
#define SEGMENT_SIZE TARGET_PAGE_SIZE
28
#endif
29
 
30
extern reloc_howto_type * NAME(aout,reloc_type_lookup)
31
  PARAMS ((bfd *, bfd_reloc_code_real_type));
32
 
33
/* Set parameters about this a.out file that are machine-dependent.
34
   This routine is called from some_aout_object_p just before it returns.  */
35
#ifndef MY_callback
36
 
37
static const bfd_target *MY(callback) PARAMS ((bfd *));
38
 
39
static const bfd_target *
40
MY(callback) (abfd)
41
     bfd *abfd;
42
{
43
  struct internal_exec *execp = exec_hdr (abfd);
44
  unsigned int arch_align_power;
45
  unsigned long arch_align;
46
 
47
  /* Calculate the file positions of the parts of a newly read aout header */
48
  obj_textsec (abfd)->_raw_size = N_TXTSIZE(*execp);
49
 
50
  /* The virtual memory addresses of the sections */
51
  obj_textsec (abfd)->vma = N_TXTADDR(*execp);
52
  obj_datasec (abfd)->vma = N_DATADDR(*execp);
53
  obj_bsssec  (abfd)->vma = N_BSSADDR(*execp);
54
 
55
  /* For some targets, if the entry point is not in the same page
56
     as the start of the text, then adjust the VMA so that it is.
57
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
58
  if (aout_backend_info (abfd)->entry_is_text_address
59
      && execp->a_entry > obj_textsec (abfd)->vma)
60
    {
61
      bfd_vma adjust;
62
 
63
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
64
      /* Adjust only by whole pages. */
65
      adjust &= ~(TARGET_PAGE_SIZE - 1);
66
      obj_textsec (abfd)->vma += adjust;
67
      obj_datasec (abfd)->vma += adjust;
68
      obj_bsssec (abfd)->vma += adjust;
69
    }
70
 
71
  /* Set the load addresses to be the same as the virtual addresses.  */
72
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
73
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
74
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
75
 
76
  /* The file offsets of the sections */
77
  obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
78
  obj_datasec (abfd)->filepos = N_DATOFF (*execp);
79
 
80
  /* The file offsets of the relocation info */
81
  obj_textsec (abfd)->rel_filepos = N_TRELOFF(*execp);
82
  obj_datasec (abfd)->rel_filepos = N_DRELOFF(*execp);
83
 
84
  /* The file offsets of the string table and symbol table.  */
85
  obj_sym_filepos (abfd) = N_SYMOFF (*execp);
86
  obj_str_filepos (abfd) = N_STROFF (*execp);
87
 
88
  /* Determine the architecture and machine type of the object file.  */
89
#ifdef SET_ARCH_MACH
90
  SET_ARCH_MACH(abfd, *execp);
91
#else
92
  bfd_default_set_arch_mach(abfd, DEFAULT_ARCH, 0);
93
#endif
94
 
95
  /* The number of relocation records.  This must be called after
96
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
97
     obj_reloc_entry_size correctly, if the reloc size is not
98
     RELOC_STD_SIZE.  */
99
  obj_textsec (abfd)->reloc_count =
100
    execp->a_trsize / obj_reloc_entry_size (abfd);
101
  obj_datasec (abfd)->reloc_count =
102
    execp->a_drsize / obj_reloc_entry_size (abfd);
103
 
104
  /* Now that we know the architecture, set the alignments of the
105
     sections.  This is normally done by NAME(aout,new_section_hook),
106
     but when the initial sections were created the architecture had
107
     not yet been set.  However, for backward compatibility, we don't
108
     set the alignment power any higher than as required by the size
109
     of the section.  */
110
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
111
  arch_align = 1 << arch_align_power;
112
  if ((BFD_ALIGN (obj_textsec (abfd)->_raw_size, arch_align)
113
       == obj_textsec (abfd)->_raw_size)
114
      && (BFD_ALIGN (obj_datasec (abfd)->_raw_size, arch_align)
115
          == obj_datasec (abfd)->_raw_size)
116
      && (BFD_ALIGN (obj_bsssec (abfd)->_raw_size, arch_align)
117
          == obj_bsssec (abfd)->_raw_size))
118
    {
119
      obj_textsec (abfd)->alignment_power = arch_align_power;
120
      obj_datasec (abfd)->alignment_power = arch_align_power;
121
      obj_bsssec (abfd)->alignment_power = arch_align_power;
122
    }
123
 
124
  /* Don't set sizes now -- can't be sure until we know arch & mach.
125
     Sizes get set in set_sizes callback, later.  */
126
#if 0
127
  adata(abfd).page_size = TARGET_PAGE_SIZE;
128
  adata(abfd).segment_size = SEGMENT_SIZE;
129
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
130
#endif
131
 
132
  return abfd->xvec;
133
}
134
#endif
135
 
136
#ifndef MY_object_p
137
/* Finish up the reading of an a.out file header */
138
 
139
static const bfd_target *MY(object_p) PARAMS ((bfd *));
140
 
141
static const bfd_target *
142
MY(object_p) (abfd)
143
     bfd *abfd;
144
{
145
  struct external_exec exec_bytes;      /* Raw exec header from file */
146
  struct internal_exec exec;            /* Cleaned-up exec header */
147
  const bfd_target *target;
148
 
149
  if (bfd_read ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)
150
      != EXEC_BYTES_SIZE) {
151
    if (bfd_get_error () != bfd_error_system_call)
152
      bfd_set_error (bfd_error_wrong_format);
153
    return 0;
154
  }
155
 
156
#ifdef SWAP_MAGIC
157
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
158
#else
159
  exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
160
#endif /* SWAP_MAGIC */
161
 
162
  if (N_BADMAG (exec)) return 0;
163
#ifdef MACHTYPE_OK
164
  if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0;
165
#endif
166
 
167
  NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec);
168
 
169
#ifdef SWAP_MAGIC
170
  /* swap_exec_header_in read in a_info with the wrong byte order */
171
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
172
#endif /* SWAP_MAGIC */
173
 
174
  target = NAME(aout,some_aout_object_p) (abfd, &exec, MY(callback));
175
 
176
#ifdef ENTRY_CAN_BE_ZERO
177
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
178
   * means that it isn't obvious if EXEC_P should be set.
179
   * All of the following must be true for an executable:
180
   * There must be no relocations, the bfd can be neither an
181
   * archive nor an archive element, and the file must be executable. */
182
 
183
  if (exec.a_trsize + exec.a_drsize == 0
184
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
185
    {
186
      struct stat buf;
187
#ifndef S_IXUSR
188
#define S_IXUSR 0100    /* Execute by owner.  */
189
#endif
190
      if (stat(abfd->filename, &buf) == 0 && (buf.st_mode & S_IXUSR))
191
        abfd->flags |= EXEC_P;
192
    }
193
#endif /* ENTRY_CAN_BE_ZERO */
194
 
195
  return target;
196
}
197
#define MY_object_p MY(object_p)
198
#endif
199
 
200
 
201
#ifndef MY_mkobject
202
 
203
static boolean MY(mkobject) PARAMS ((bfd *));
204
 
205
static boolean
206
MY(mkobject) (abfd)
207
     bfd *abfd;
208
{
209
  if (NAME(aout,mkobject)(abfd) == false)
210
    return false;
211
#if 0 /* Sizes get set in set_sizes callback, later, after we know
212
         the architecture and machine.  */
213
  adata(abfd).page_size = TARGET_PAGE_SIZE;
214
  adata(abfd).segment_size = SEGMENT_SIZE;
215
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
216
#endif
217
  return true;
218
}
219
#define MY_mkobject MY(mkobject)
220
#endif
221
 
222
#ifndef MY_bfd_copy_private_section_data
223
 
224
/* Copy private section data.  This actually does nothing with the
225
   sections.  It copies the subformat field.  We copy it here, because
226
   we need to know whether this is a QMAGIC file before we set the
227
   section contents, and copy_private_bfd_data is not called until
228
   after the section contents have been set.  */
229
 
230
static boolean MY_bfd_copy_private_section_data
231
  PARAMS ((bfd *, asection *, bfd *, asection *));
232
 
233
/*ARGSUSED*/
234
static boolean
235
MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec)
236
     bfd *ibfd;
237
     asection *isec ATTRIBUTE_UNUSED;
238
     bfd *obfd;
239
     asection *osec ATTRIBUTE_UNUSED;
240
{
241
  if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
242
      && bfd_get_flavour (obfd) == bfd_target_aout_flavour)
243
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
244
  return true;
245
}
246
 
247
#endif
248
 
249
/* Write an object file.
250
   Section contents have already been written.  We write the
251
   file header, symbols, and relocation.  */
252
 
253
#ifndef MY_write_object_contents
254
static boolean
255
MY(write_object_contents) (abfd)
256
     bfd *abfd;
257
{
258
  struct external_exec exec_bytes;
259
  struct internal_exec *execp = exec_hdr (abfd);
260
 
261
  obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
262
 
263
  WRITE_HEADERS(abfd, execp);
264
 
265
  return true;
266
}
267
#define MY_write_object_contents MY(write_object_contents)
268
#endif
269
 
270
#ifndef MY_set_sizes
271
 
272
static boolean MY(set_sizes) PARAMS ((bfd *));
273
 
274
static boolean
275
MY(set_sizes) (abfd)
276
     bfd *abfd;
277
{
278
  adata(abfd).page_size = TARGET_PAGE_SIZE;
279
  adata(abfd).segment_size = SEGMENT_SIZE;
280
 
281
#ifdef ZMAGIC_DISK_BLOCK_SIZE
282
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
283
#else
284
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
285
#endif
286
 
287
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
288
  return true;
289
}
290
#define MY_set_sizes MY(set_sizes)
291
#endif
292
 
293
#ifndef MY_exec_hdr_flags
294
#define MY_exec_hdr_flags 0
295
#endif
296
 
297
#ifndef MY_backend_data
298
 
299
#ifndef MY_zmagic_contiguous
300
#define MY_zmagic_contiguous 0
301
#endif
302
#ifndef MY_text_includes_header
303
#define MY_text_includes_header 0
304
#endif
305
#ifndef MY_entry_is_text_address
306
#define MY_entry_is_text_address 0
307
#endif
308
#ifndef MY_exec_header_not_counted
309
#define MY_exec_header_not_counted 0
310
#endif
311
#ifndef MY_add_dynamic_symbols
312
#define MY_add_dynamic_symbols 0
313
#endif
314
#ifndef MY_add_one_symbol
315
#define MY_add_one_symbol 0
316
#endif
317
#ifndef MY_link_dynamic_object
318
#define MY_link_dynamic_object 0
319
#endif
320
#ifndef MY_write_dynamic_symbol
321
#define MY_write_dynamic_symbol 0
322
#endif
323
#ifndef MY_check_dynamic_reloc
324
#define MY_check_dynamic_reloc 0
325
#endif
326
#ifndef MY_finish_dynamic_link
327
#define MY_finish_dynamic_link 0
328
#endif
329
 
330
static CONST struct aout_backend_data MY(backend_data) = {
331
  MY_zmagic_contiguous,
332
  MY_text_includes_header,
333
  MY_entry_is_text_address,
334
  MY_exec_hdr_flags,
335
  0,                             /* text vma? */
336
  MY_set_sizes,
337
  MY_exec_header_not_counted,
338
  MY_add_dynamic_symbols,
339
  MY_add_one_symbol,
340
  MY_link_dynamic_object,
341
  MY_write_dynamic_symbol,
342
  MY_check_dynamic_reloc,
343
  MY_finish_dynamic_link
344
};
345
#define MY_backend_data &MY(backend_data)
346
#endif
347
 
348
#ifndef MY_final_link_callback
349
 
350
/* Callback for the final_link routine to set the section offsets.  */
351
 
352
static void MY_final_link_callback
353
  PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
354
 
355
static void
356
MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff)
357
     bfd *abfd;
358
     file_ptr *ptreloff;
359
     file_ptr *pdreloff;
360
     file_ptr *psymoff;
361
{
362
  struct internal_exec *execp = exec_hdr (abfd);
363
 
364
  *ptreloff = N_TRELOFF (*execp);
365
  *pdreloff = N_DRELOFF (*execp);
366
  *psymoff = N_SYMOFF (*execp);
367
}
368
 
369
#endif
370
 
371
#ifndef MY_bfd_final_link
372
 
373
/* Final link routine.  We need to use a call back to get the correct
374
   offsets in the output file.  */
375
 
376
static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *));
377
 
378
static boolean
379
MY_bfd_final_link (abfd, info)
380
     bfd *abfd;
381
     struct bfd_link_info *info;
382
{
383
  return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
384
}
385
 
386
#endif
387
 
388
/* We assume BFD generic archive files.  */
389
#ifndef MY_openr_next_archived_file
390
#define MY_openr_next_archived_file     bfd_generic_openr_next_archived_file
391
#endif
392
#ifndef MY_get_elt_at_index
393
#define MY_get_elt_at_index             _bfd_generic_get_elt_at_index
394
#endif
395
#ifndef MY_generic_stat_arch_elt
396
#define MY_generic_stat_arch_elt        bfd_generic_stat_arch_elt
397
#endif
398
#ifndef MY_slurp_armap
399
#define MY_slurp_armap                  bfd_slurp_bsd_armap
400
#endif
401
#ifndef MY_slurp_extended_name_table
402
#define MY_slurp_extended_name_table    _bfd_slurp_extended_name_table
403
#endif
404
#ifndef MY_construct_extended_name_table
405
#define MY_construct_extended_name_table \
406
  _bfd_archive_bsd_construct_extended_name_table
407
#endif
408
#ifndef MY_write_armap
409
#define MY_write_armap          bsd_write_armap
410
#endif
411
#ifndef MY_read_ar_hdr
412
#define MY_read_ar_hdr          _bfd_generic_read_ar_hdr
413
#endif
414
#ifndef MY_truncate_arname
415
#define MY_truncate_arname              bfd_bsd_truncate_arname
416
#endif
417
#ifndef MY_update_armap_timestamp
418
#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
419
#endif
420
 
421
/* No core file defined here -- configure in trad-core.c separately.  */
422
#ifndef MY_core_file_failing_command
423
#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
424
#endif
425
#ifndef MY_core_file_failing_signal
426
#define MY_core_file_failing_signal     _bfd_nocore_core_file_failing_signal
427
#endif
428
#ifndef MY_core_file_matches_executable_p
429
#define MY_core_file_matches_executable_p       \
430
                                _bfd_nocore_core_file_matches_executable_p
431
#endif
432
#ifndef MY_core_file_p
433
#define MY_core_file_p          _bfd_dummy_target
434
#endif
435
 
436
#ifndef MY_bfd_debug_info_start
437
#define MY_bfd_debug_info_start         bfd_void
438
#endif
439
#ifndef MY_bfd_debug_info_end
440
#define MY_bfd_debug_info_end           bfd_void
441
#endif
442
#ifndef MY_bfd_debug_info_accumulate
443
#define MY_bfd_debug_info_accumulate    \
444
                        (void (*) PARAMS ((bfd*, struct sec *))) bfd_void
445
#endif
446
 
447
#ifndef MY_core_file_failing_command
448
#define MY_core_file_failing_command NAME(aout,core_file_failing_command)
449
#endif
450
#ifndef MY_core_file_failing_signal
451
#define MY_core_file_failing_signal NAME(aout,core_file_failing_signal)
452
#endif
453
#ifndef MY_core_file_matches_executable_p
454
#define MY_core_file_matches_executable_p NAME(aout,core_file_matches_executable_p)
455
#endif
456
#ifndef MY_set_section_contents
457
#define MY_set_section_contents NAME(aout,set_section_contents)
458
#endif
459
#ifndef MY_get_section_contents
460
#define MY_get_section_contents NAME(aout,get_section_contents)
461
#endif
462
#ifndef MY_get_section_contents_in_window
463
#define MY_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
464
#endif
465
#ifndef MY_new_section_hook
466
#define MY_new_section_hook NAME(aout,new_section_hook)
467
#endif
468
#ifndef MY_get_symtab_upper_bound
469
#define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound)
470
#endif
471
#ifndef MY_get_symtab
472
#define MY_get_symtab NAME(aout,get_symtab)
473
#endif
474
#ifndef MY_get_reloc_upper_bound
475
#define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound)
476
#endif
477
#ifndef MY_canonicalize_reloc
478
#define MY_canonicalize_reloc NAME(aout,canonicalize_reloc)
479
#endif
480
#ifndef MY_make_empty_symbol
481
#define MY_make_empty_symbol NAME(aout,make_empty_symbol)
482
#endif
483
#ifndef MY_print_symbol
484
#define MY_print_symbol NAME(aout,print_symbol)
485
#endif
486
#ifndef MY_get_symbol_info
487
#define MY_get_symbol_info NAME(aout,get_symbol_info)
488
#endif
489
#ifndef MY_get_lineno
490
#define MY_get_lineno NAME(aout,get_lineno)
491
#endif
492
#ifndef MY_set_arch_mach
493
#define MY_set_arch_mach NAME(aout,set_arch_mach)
494
#endif
495
#ifndef MY_find_nearest_line
496
#define MY_find_nearest_line NAME(aout,find_nearest_line)
497
#endif
498
#ifndef MY_sizeof_headers
499
#define MY_sizeof_headers NAME(aout,sizeof_headers)
500
#endif
501
#ifndef MY_bfd_get_relocated_section_contents
502
#define MY_bfd_get_relocated_section_contents \
503
                        bfd_generic_get_relocated_section_contents
504
#endif
505
#ifndef MY_bfd_relax_section
506
#define MY_bfd_relax_section bfd_generic_relax_section
507
#endif
508
#ifndef MY_bfd_gc_sections
509
#define MY_bfd_gc_sections bfd_generic_gc_sections
510
#endif
511
#ifndef MY_bfd_reloc_type_lookup
512
#define MY_bfd_reloc_type_lookup NAME(aout,reloc_type_lookup)
513
#endif
514
#ifndef MY_bfd_make_debug_symbol
515
#define MY_bfd_make_debug_symbol 0
516
#endif
517
#ifndef MY_read_minisymbols
518
#define MY_read_minisymbols NAME(aout,read_minisymbols)
519
#endif
520
#ifndef MY_minisymbol_to_symbol
521
#define MY_minisymbol_to_symbol NAME(aout,minisymbol_to_symbol)
522
#endif
523
#ifndef MY_bfd_link_hash_table_create
524
#define MY_bfd_link_hash_table_create NAME(aout,link_hash_table_create)
525
#endif
526
#ifndef MY_bfd_link_add_symbols
527
#define MY_bfd_link_add_symbols NAME(aout,link_add_symbols)
528
#endif
529
#ifndef MY_bfd_link_split_section
530
#define MY_bfd_link_split_section  _bfd_generic_link_split_section
531
#endif
532
 
533
 
534
#ifndef MY_bfd_copy_private_bfd_data
535
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
536
#endif
537
 
538
#ifndef MY_bfd_merge_private_bfd_data
539
#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
540
#endif
541
 
542
#ifndef MY_bfd_copy_private_symbol_data
543
#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
544
#endif
545
 
546
#ifndef MY_bfd_print_private_bfd_data
547
#define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
548
#endif
549
 
550
#ifndef MY_bfd_set_private_flags
551
#define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
552
#endif
553
 
554
#ifndef MY_bfd_is_local_label_name
555
#define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
556
#endif
557
 
558
#ifndef MY_bfd_free_cached_info
559
#define MY_bfd_free_cached_info NAME(aout,bfd_free_cached_info)
560
#endif
561
 
562
#ifndef MY_close_and_cleanup
563
#define MY_close_and_cleanup MY_bfd_free_cached_info
564
#endif
565
 
566
#ifndef MY_get_dynamic_symtab_upper_bound
567
#define MY_get_dynamic_symtab_upper_bound \
568
  _bfd_nodynamic_get_dynamic_symtab_upper_bound
569
#endif
570
#ifndef MY_canonicalize_dynamic_symtab
571
#define MY_canonicalize_dynamic_symtab \
572
  _bfd_nodynamic_canonicalize_dynamic_symtab
573
#endif
574
#ifndef MY_get_dynamic_reloc_upper_bound
575
#define MY_get_dynamic_reloc_upper_bound \
576
  _bfd_nodynamic_get_dynamic_reloc_upper_bound
577
#endif
578
#ifndef MY_canonicalize_dynamic_reloc
579
#define MY_canonicalize_dynamic_reloc \
580
  _bfd_nodynamic_canonicalize_dynamic_reloc
581
#endif
582
 
583
/* Aout symbols normally have leading underscores */
584
#ifndef MY_symbol_leading_char 
585
#define MY_symbol_leading_char '_'
586
#endif
587
 
588
/* Aout archives normally use spaces for padding */
589
#ifndef AR_PAD_CHAR
590
#define AR_PAD_CHAR ' '
591
#endif
592
 
593
#ifndef MY_BFD_TARGET
594
const bfd_target MY(vec) =
595
{
596
  TARGETNAME,           /* name */
597
  bfd_target_aout_flavour,
598
#ifdef TARGET_IS_BIG_ENDIAN_P
599
  BFD_ENDIAN_BIG,               /* target byte order (big) */
600
  BFD_ENDIAN_BIG,               /* target headers byte order (big) */
601
#else
602
  BFD_ENDIAN_LITTLE,            /* target byte order (little) */
603
  BFD_ENDIAN_LITTLE,            /* target headers byte order (little) */
604
#endif
605
  (HAS_RELOC | EXEC_P |         /* object flags */
606
   HAS_LINENO | HAS_DEBUG |
607
   HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
608
  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
609
  MY_symbol_leading_char,
610
  AR_PAD_CHAR,                  /* ar_pad_char */
611
  15,                           /* ar_max_namelen */
612
#ifdef TARGET_IS_BIG_ENDIAN_P
613
  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
614
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
615
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */
616
  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
617
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
618
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */
619
#else
620
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
621
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
622
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */
623
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
624
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
625
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */
626
#endif
627
    {_bfd_dummy_target, MY_object_p, /* bfd_check_format */
628
       bfd_generic_archive_p, MY_core_file_p},
629
    {bfd_false, MY_mkobject,    /* bfd_set_format */
630
       _bfd_generic_mkarchive, bfd_false},
631
    {bfd_false, MY_write_object_contents, /* bfd_write_contents */
632
       _bfd_write_archive_contents, bfd_false},
633
 
634
     BFD_JUMP_TABLE_GENERIC (MY),
635
     BFD_JUMP_TABLE_COPY (MY),
636
     BFD_JUMP_TABLE_CORE (MY),
637
     BFD_JUMP_TABLE_ARCHIVE (MY),
638
     BFD_JUMP_TABLE_SYMBOLS (MY),
639
     BFD_JUMP_TABLE_RELOCS (MY),
640
     BFD_JUMP_TABLE_WRITE (MY),
641
     BFD_JUMP_TABLE_LINK (MY),
642
     BFD_JUMP_TABLE_DYNAMIC (MY),
643
 
644
  /* Alternative_target */
645
  NULL,
646
 
647
  (PTR) MY_backend_data
648
};
649
#endif /* MY_BFD_TARGET */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.