Coverage Report

Created: 2026-05-11 07:54

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
4.58k
#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
10.7k
{
40
10.7k
  struct internal_exec *execp = exec_hdr (abfd);
41
10.7k
  unsigned int arch_align_power;
42
10.7k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
10.7k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
10.7k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
10.7k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
10.7k
  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
10.7k
  if (aout_backend_info (abfd)->entry_is_text_address
56
4.67k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
3.33k
    {
58
3.33k
      bfd_vma adjust;
59
60
3.33k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
3.33k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
3.33k
      obj_textsec (abfd)->vma += adjust;
64
3.33k
      obj_datasec (abfd)->vma += adjust;
65
3.33k
      obj_bsssec (abfd)->vma += adjust;
66
3.33k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
10.7k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
10.7k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
10.7k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
10.7k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
10.7k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
10.7k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
10.7k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
10.7k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
10.7k
  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
901
  SET_ARCH_MACH (abfd, execp);
88
#else
89
9.85k
  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
10.7k
  obj_textsec (abfd)->reloc_count =
97
10.7k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
10.7k
  obj_datasec (abfd)->reloc_count =
99
10.7k
    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
10.7k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
10.7k
  arch_align = 1 << arch_align_power;
109
10.7k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
10.7k
       == obj_textsec (abfd)->size)
111
5.61k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
5.61k
    == obj_datasec (abfd)->size)
113
3.52k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
3.52k
    == obj_bsssec (abfd)->size))
115
1.49k
    {
116
1.49k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.49k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.49k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.49k
    }
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
10.7k
  return _bfd_no_cleanup;
125
10.7k
}
aout-cris.c:cris_aout_callback
Line
Count
Source
39
901
{
40
901
  struct internal_exec *execp = exec_hdr (abfd);
41
901
  unsigned int arch_align_power;
42
901
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
901
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
901
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
901
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
901
  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
901
  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
901
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
901
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
901
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
901
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
901
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
901
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
901
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
901
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
901
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
901
#ifdef SET_ARCH_MACH
87
901
  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
901
  obj_textsec (abfd)->reloc_count =
97
901
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
901
  obj_datasec (abfd)->reloc_count =
99
901
    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
901
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
901
  arch_align = 1 << arch_align_power;
109
901
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
901
       == obj_textsec (abfd)->size)
111
410
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
410
    == obj_datasec (abfd)->size)
113
290
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
290
    == obj_bsssec (abfd)->size))
115
163
    {
116
163
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
163
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
163
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
163
    }
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
901
  return _bfd_no_cleanup;
125
901
}
i386aout.c:i386_aout_callback
Line
Count
Source
39
1.56k
{
40
1.56k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.56k
  unsigned int arch_align_power;
42
1.56k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.56k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.56k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.56k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.56k
  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.56k
  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.56k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.56k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.56k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.56k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.56k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.56k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.56k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.56k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.56k
  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.56k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.56k
#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.56k
  obj_textsec (abfd)->reloc_count =
97
1.56k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.56k
  obj_datasec (abfd)->reloc_count =
99
1.56k
    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.56k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.56k
  arch_align = 1 << arch_align_power;
109
1.56k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.56k
       == obj_textsec (abfd)->size)
111
712
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
712
    == obj_datasec (abfd)->size)
113
435
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
435
    == obj_bsssec (abfd)->size))
115
164
    {
116
164
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
164
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
164
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
164
    }
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.56k
  return _bfd_no_cleanup;
125
1.56k
}
i386bsd.c:i386_aout_bsd_callback
Line
Count
Source
39
476
{
40
476
  struct internal_exec *execp = exec_hdr (abfd);
41
476
  unsigned int arch_align_power;
42
476
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
476
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
476
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
476
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
476
  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
476
  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
476
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
476
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
476
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
476
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
476
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
476
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
476
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
476
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
476
  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
476
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
476
#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
476
  obj_textsec (abfd)->reloc_count =
97
476
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
476
  obj_datasec (abfd)->reloc_count =
99
476
    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
476
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
476
  arch_align = 1 << arch_align_power;
109
476
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
476
       == obj_textsec (abfd)->size)
111
336
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
336
    == obj_datasec (abfd)->size)
113
224
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
224
    == obj_bsssec (abfd)->size))
115
78
    {
116
78
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
78
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
78
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
78
    }
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
476
  return _bfd_no_cleanup;
125
476
}
i386lynx.c:i386_aout_lynx_callback
Line
Count
Source
39
1.56k
{
40
1.56k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.56k
  unsigned int arch_align_power;
42
1.56k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.56k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.56k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.56k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.56k
  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.56k
  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.56k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.56k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.56k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.56k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.56k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.56k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.56k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.56k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.56k
  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.56k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.56k
#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.56k
  obj_textsec (abfd)->reloc_count =
97
1.56k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.56k
  obj_datasec (abfd)->reloc_count =
99
1.56k
    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.56k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.56k
  arch_align = 1 << arch_align_power;
109
1.56k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.56k
       == obj_textsec (abfd)->size)
111
716
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
716
    == obj_datasec (abfd)->size)
113
439
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
439
    == obj_bsssec (abfd)->size))
115
168
    {
116
168
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
168
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
168
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
168
    }
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.56k
  return _bfd_no_cleanup;
125
1.56k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_callback
Line
Count
Source
39
1.01k
{
40
1.01k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.01k
  unsigned int arch_align_power;
42
1.01k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.01k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.01k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.01k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.01k
  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.01k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.01k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
767
    {
58
767
      bfd_vma adjust;
59
60
767
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
767
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
767
      obj_textsec (abfd)->vma += adjust;
64
767
      obj_datasec (abfd)->vma += adjust;
65
767
      obj_bsssec (abfd)->vma += adjust;
66
767
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.01k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.01k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.01k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.01k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.01k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.01k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.01k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.01k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.01k
  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.01k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.01k
#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.01k
  obj_textsec (abfd)->reloc_count =
97
1.01k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.01k
  obj_datasec (abfd)->reloc_count =
99
1.01k
    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.01k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.01k
  arch_align = 1 << arch_align_power;
109
1.01k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.01k
       == obj_textsec (abfd)->size)
111
642
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
642
    == obj_datasec (abfd)->size)
113
356
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
356
    == 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.01k
  return _bfd_no_cleanup;
125
1.01k
}
pc532-mach.c:ns32k_aout_pc532mach_callback
Line
Count
Source
39
1.56k
{
40
1.56k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.56k
  unsigned int arch_align_power;
42
1.56k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.56k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.56k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.56k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.56k
  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.56k
  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.56k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.56k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.56k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.56k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.56k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.56k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.56k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.56k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.56k
  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.56k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.56k
#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.56k
  obj_textsec (abfd)->reloc_count =
97
1.56k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.56k
  obj_datasec (abfd)->reloc_count =
99
1.56k
    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.56k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.56k
  arch_align = 1 << arch_align_power;
109
1.56k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.56k
       == obj_textsec (abfd)->size)
111
712
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
712
    == obj_datasec (abfd)->size)
113
435
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
435
    == obj_bsssec (abfd)->size))
115
164
    {
116
164
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
164
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
164
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
164
    }
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.56k
  return _bfd_no_cleanup;
125
1.56k
}
pdp11.c:pdp11_aout_callback
Line
Count
Source
39
1.98k
{
40
1.98k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.98k
  unsigned int arch_align_power;
42
1.98k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.98k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.98k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.98k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.98k
  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.98k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.98k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
1.21k
    {
58
1.21k
      bfd_vma adjust;
59
60
1.21k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
1.21k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
1.21k
      obj_textsec (abfd)->vma += adjust;
64
1.21k
      obj_datasec (abfd)->vma += adjust;
65
1.21k
      obj_bsssec (abfd)->vma += adjust;
66
1.21k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.98k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.98k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.98k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.98k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.98k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.98k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.98k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.98k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.98k
  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.98k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.98k
#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.98k
  obj_textsec (abfd)->reloc_count =
97
1.98k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.98k
  obj_datasec (abfd)->reloc_count =
99
1.98k
    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.98k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.98k
  arch_align = 1 << arch_align_power;
109
1.98k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.98k
       == obj_textsec (abfd)->size)
111
934
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
934
    == obj_datasec (abfd)->size)
113
700
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
700
    == obj_bsssec (abfd)->size))
115
377
    {
116
377
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
377
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
377
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
377
    }
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.98k
  return _bfd_no_cleanup;
125
1.98k
}
vax1knetbsd.c:vax_aout_1knbsd_callback
Line
Count
Source
39
971
{
40
971
  struct internal_exec *execp = exec_hdr (abfd);
41
971
  unsigned int arch_align_power;
42
971
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
971
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
971
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
971
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
971
  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
971
  if (aout_backend_info (abfd)->entry_is_text_address
56
971
      && execp->a_entry > obj_textsec (abfd)->vma)
57
788
    {
58
788
      bfd_vma adjust;
59
60
788
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
788
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
788
      obj_textsec (abfd)->vma += adjust;
64
788
      obj_datasec (abfd)->vma += adjust;
65
788
      obj_bsssec (abfd)->vma += adjust;
66
788
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
971
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
971
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
971
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
971
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
971
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
971
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
971
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
971
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
971
  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
971
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
971
#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
971
  obj_textsec (abfd)->reloc_count =
97
971
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
971
  obj_datasec (abfd)->reloc_count =
99
971
    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
971
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
971
  arch_align = 1 << arch_align_power;
109
971
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
971
       == obj_textsec (abfd)->size)
111
635
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
635
    == obj_datasec (abfd)->size)
113
372
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
372
    == obj_bsssec (abfd)->size))
115
154
    {
116
154
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
154
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
154
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
154
    }
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
971
  return _bfd_no_cleanup;
125
971
}
vaxnetbsd.c:vax_aout_nbsd_callback
Line
Count
Source
39
705
{
40
705
  struct internal_exec *execp = exec_hdr (abfd);
41
705
  unsigned int arch_align_power;
42
705
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
705
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
705
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
705
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
705
  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
705
  if (aout_backend_info (abfd)->entry_is_text_address
56
705
      && execp->a_entry > obj_textsec (abfd)->vma)
57
562
    {
58
562
      bfd_vma adjust;
59
60
562
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
562
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
562
      obj_textsec (abfd)->vma += adjust;
64
562
      obj_datasec (abfd)->vma += adjust;
65
562
      obj_bsssec (abfd)->vma += adjust;
66
562
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
705
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
705
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
705
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
705
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
705
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
705
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
705
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
705
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
705
  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
705
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
705
#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
705
  obj_textsec (abfd)->reloc_count =
97
705
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
705
  obj_datasec (abfd)->reloc_count =
99
705
    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
705
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
705
  arch_align = 1 << arch_align_power;
109
705
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
705
       == obj_textsec (abfd)->size)
111
516
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
516
    == obj_datasec (abfd)->size)
113
273
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
273
    == obj_bsssec (abfd)->size))
115
101
    {
116
101
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
101
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
101
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
101
    }
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
705
  return _bfd_no_cleanup;
125
705
}
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
1.23M
{
134
1.23M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
1.23M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
1.23M
  bfd_cleanup cleanup;
137
1.23M
  size_t amt = EXEC_BYTES_SIZE;
138
139
1.23M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
54.7k
    {
141
54.7k
      if (bfd_get_error () != bfd_error_system_call)
142
54.4k
  bfd_set_error (bfd_error_wrong_format);
143
54.7k
      return 0;
144
54.7k
    }
145
146
#ifdef SWAP_MAGIC
147
526k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
656k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
#endif
151
152
1.18M
  if (N_BADMAG (&exec))
153
1.16M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
10.1k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
6.12k
    return 0;
158
4.06k
#endif
159
160
10.7k
  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
4.67k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
#endif
166
167
10.7k
  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
901
  if (exec.a_trsize + exec.a_drsize == 0
177
310
      && 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
10.7k
  return cleanup;
190
10.1k
}
aout-cris.c:cris_aout_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.55k
    {
141
6.55k
      if (bfd_get_error () != bfd_error_system_call)
142
6.52k
  bfd_set_error (bfd_error_wrong_format);
143
6.55k
      return 0;
144
6.55k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
131k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
131k
#endif
151
152
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
1.56k
#ifdef MACHTYPE_OK
156
1.56k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
666
    return 0;
158
901
#endif
159
160
901
  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
901
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
901
#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
901
  if (exec.a_trsize + exec.a_drsize == 0
177
310
      && 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
901
#endif /* ENTRY_CAN_BE_ZERO */
188
189
901
  return cleanup;
190
1.56k
}
i386aout.c:i386_aout_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.55k
    {
141
6.55k
      if (bfd_get_error () != bfd_error_system_call)
142
6.52k
  bfd_set_error (bfd_error_wrong_format);
143
6.55k
      return 0;
144
6.55k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
131k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
131k
#endif
151
152
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.56k
  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.56k
  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.56k
  return cleanup;
190
131k
}
i386bsd.c:i386_aout_bsd_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.55k
    {
141
6.55k
      if (bfd_get_error () != bfd_error_system_call)
142
6.52k
  bfd_set_error (bfd_error_wrong_format);
143
6.55k
      return 0;
144
6.55k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
131k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
131k
#endif
151
152
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
1.56k
#ifdef MACHTYPE_OK
156
1.56k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.09k
    return 0;
158
476
#endif
159
160
476
  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
476
  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
476
  return cleanup;
190
1.56k
}
i386lynx.c:i386_aout_lynx_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.55k
    {
141
6.55k
      if (bfd_get_error () != bfd_error_system_call)
142
6.52k
  bfd_set_error (bfd_error_wrong_format);
143
6.55k
      return 0;
144
6.55k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
131k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
131k
#endif
151
152
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.56k
  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.56k
  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.56k
  return cleanup;
190
131k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.59k
    {
141
6.59k
      if (bfd_get_error () != bfd_error_system_call)
142
6.56k
  bfd_set_error (bfd_error_wrong_format);
143
6.59k
      return 0;
144
6.59k
    }
145
146
131k
#ifdef SWAP_MAGIC
147
131k
  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
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
2.35k
#ifdef MACHTYPE_OK
156
2.35k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.34k
    return 0;
158
1.01k
#endif
159
160
1.01k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.01k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.01k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.01k
#endif
166
167
1.01k
  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.01k
  return cleanup;
190
2.35k
}
pc532-mach.c:ns32k_aout_pc532mach_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.59k
    {
141
6.59k
      if (bfd_get_error () != bfd_error_system_call)
142
6.56k
  bfd_set_error (bfd_error_wrong_format);
143
6.59k
      return 0;
144
6.59k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
131k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
131k
#endif
151
152
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.56k
  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.56k
  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.56k
  return cleanup;
190
131k
}
pdp11.c:pdp11_aout_object_p
Line
Count
Source
133
134k
{
134
134k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
134k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
134k
  bfd_cleanup cleanup;
137
134k
  size_t amt = EXEC_BYTES_SIZE;
138
139
134k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
2.13k
    {
141
2.13k
      if (bfd_get_error () != bfd_error_system_call)
142
2.10k
  bfd_set_error (bfd_error_wrong_format);
143
2.13k
      return 0;
144
2.13k
    }
145
146
132k
#ifdef SWAP_MAGIC
147
132k
  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
132k
  if (N_BADMAG (&exec))
153
130k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.98k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.98k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.98k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.98k
#endif
166
167
1.98k
  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.98k
  return cleanup;
190
132k
}
vax1knetbsd.c:vax_aout_1knbsd_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.59k
    {
141
6.59k
      if (bfd_get_error () != bfd_error_system_call)
142
6.56k
  bfd_set_error (bfd_error_wrong_format);
143
6.59k
      return 0;
144
6.59k
    }
145
146
131k
#ifdef SWAP_MAGIC
147
131k
  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
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
2.35k
#ifdef MACHTYPE_OK
156
2.35k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.38k
    return 0;
158
971
#endif
159
160
971
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
971
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
971
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
971
#endif
166
167
971
  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
971
  return cleanup;
190
2.35k
}
vaxnetbsd.c:vax_aout_nbsd_object_p
Line
Count
Source
133
137k
{
134
137k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
137k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
137k
  bfd_cleanup cleanup;
137
137k
  size_t amt = EXEC_BYTES_SIZE;
138
139
137k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
6.59k
    {
141
6.59k
      if (bfd_get_error () != bfd_error_system_call)
142
6.56k
  bfd_set_error (bfd_error_wrong_format);
143
6.59k
      return 0;
144
6.59k
    }
145
146
131k
#ifdef SWAP_MAGIC
147
131k
  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
131k
  if (N_BADMAG (&exec))
153
129k
    return 0;
154
155
2.33k
#ifdef MACHTYPE_OK
156
2.33k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.63k
    return 0;
158
705
#endif
159
160
705
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
705
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
705
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
705
#endif
166
167
705
  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
705
  return cleanup;
190
2.33k
}
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
46
{
199
46
  return NAME (aout, mkobject (abfd));
200
46
}
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
21
{
199
21
  return NAME (aout, mkobject (abfd));
200
21
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_mkobject
pdp11.c:pdp11_aout_mkobject
Line
Count
Source
198
22
{
199
22
  return NAME (aout, mkobject (abfd));
200
22
}
Unexecuted instantiation: vax1knetbsd.c:vax_aout_1knbsd_mkobject
vaxnetbsd.c:vax_aout_nbsd_mkobject
Line
Count
Source
198
3
{
199
3
  return NAME (aout, mkobject (abfd));
200
3
}
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
48
{
220
48
  if (link_info == NULL
221
48
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
48
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
48
  return true;
224
48
}
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
30
{
220
30
  if (link_info == NULL
221
30
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
30
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
30
}
Unexecuted instantiation: pc532-mach.c:MY_bfd_copy_private_section_data
pdp11.c:MY_bfd_copy_private_section_data
Line
Count
Source
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
  return true;
224
15
}
Unexecuted instantiation: vax1knetbsd.c:MY_bfd_copy_private_section_data
vaxnetbsd.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
}
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
46
{
254
46
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
46
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
46
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
46
  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
46
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
46
  return true;
265
46
}
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
21
{
254
21
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
21
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
21
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
21
  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
21
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
21
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_set_sizes
pdp11.c:pdp11_aout_set_sizes
Line
Count
Source
253
22
{
254
22
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
22
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
22
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
22
  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
22
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
22
}
Unexecuted instantiation: vax1knetbsd.c:vax_aout_1knbsd_set_sizes
vaxnetbsd.c:vax_aout_nbsd_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
}
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 */