Coverage Report

Created: 2026-04-04 08:16

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