Coverage Report

Created: 2023-08-28 06:25

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