Coverage Report

Created: 2026-10-02 09:53

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.89k
#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
11.6k
{
40
11.6k
  struct internal_exec *execp = exec_hdr (abfd);
41
11.6k
  unsigned int arch_align_power;
42
11.6k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
11.6k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
11.6k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
11.6k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
11.6k
  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
11.6k
  if (aout_backend_info (abfd)->entry_is_text_address
56
5.46k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
3.95k
    {
58
3.95k
      bfd_vma adjust;
59
60
3.95k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
3.95k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
3.95k
      obj_textsec (abfd)->vma += adjust;
64
3.95k
      obj_datasec (abfd)->vma += adjust;
65
3.95k
      obj_bsssec (abfd)->vma += adjust;
66
3.95k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
11.6k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
11.6k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
11.6k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
11.6k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
11.6k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
11.6k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
11.6k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
11.6k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
11.6k
  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
850
  SET_ARCH_MACH (abfd, execp);
88
#else
89
10.8k
  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
11.6k
  obj_textsec (abfd)->reloc_count =
97
11.6k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
11.6k
  obj_datasec (abfd)->reloc_count =
99
11.6k
    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
11.6k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
11.6k
  arch_align = 1 << arch_align_power;
109
11.6k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
11.6k
       == obj_textsec (abfd)->size)
111
6.70k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
6.70k
    == obj_datasec (abfd)->size)
113
4.16k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.16k
    == obj_bsssec (abfd)->size))
115
1.64k
    {
116
1.64k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.64k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.64k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.64k
    }
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
11.6k
  return _bfd_no_cleanup;
125
11.6k
}
aout-cris.c:cris_aout_callback
Line
Count
Source
39
850
{
40
850
  struct internal_exec *execp = exec_hdr (abfd);
41
850
  unsigned int arch_align_power;
42
850
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
850
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
850
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
850
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
850
  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
850
  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
850
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
850
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
850
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
850
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
850
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
850
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
850
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
850
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
850
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
850
#ifdef SET_ARCH_MACH
87
850
  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
850
  obj_textsec (abfd)->reloc_count =
97
850
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
850
  obj_datasec (abfd)->reloc_count =
99
850
    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
850
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
850
  arch_align = 1 << arch_align_power;
109
850
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
850
       == obj_textsec (abfd)->size)
111
509
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
509
    == obj_datasec (abfd)->size)
113
343
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
343
    == obj_bsssec (abfd)->size))
115
161
    {
116
161
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
161
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
161
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
161
    }
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
850
  return _bfd_no_cleanup;
125
850
}
i386aout.c:i386_aout_callback
Line
Count
Source
39
1.58k
{
40
1.58k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.58k
  unsigned int arch_align_power;
42
1.58k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.58k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.58k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.58k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.58k
  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.58k
  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.58k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.58k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.58k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.58k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.58k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.58k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.58k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.58k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.58k
  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.58k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.58k
#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.58k
  obj_textsec (abfd)->reloc_count =
97
1.58k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.58k
  obj_datasec (abfd)->reloc_count =
99
1.58k
    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.58k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.58k
  arch_align = 1 << arch_align_power;
109
1.58k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.58k
       == obj_textsec (abfd)->size)
111
842
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
842
    == obj_datasec (abfd)->size)
113
487
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
487
    == obj_bsssec (abfd)->size))
115
160
    {
116
160
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
160
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
160
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
160
    }
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.58k
  return _bfd_no_cleanup;
125
1.58k
}
i386bsd.c:i386_aout_bsd_callback
Line
Count
Source
39
595
{
40
595
  struct internal_exec *execp = exec_hdr (abfd);
41
595
  unsigned int arch_align_power;
42
595
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
595
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
595
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
595
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
595
  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
595
  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
595
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
595
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
595
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
595
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
595
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
595
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
595
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
595
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
595
  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
595
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
595
#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
595
  obj_textsec (abfd)->reloc_count =
97
595
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
595
  obj_datasec (abfd)->reloc_count =
99
595
    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
595
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
595
  arch_align = 1 << arch_align_power;
109
595
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
595
       == obj_textsec (abfd)->size)
111
437
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
437
    == obj_datasec (abfd)->size)
113
285
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
285
    == obj_bsssec (abfd)->size))
115
92
    {
116
92
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
92
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
92
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
92
    }
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
595
  return _bfd_no_cleanup;
125
595
}
i386lynx.c:i386_aout_lynx_callback
Line
Count
Source
39
1.58k
{
40
1.58k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.58k
  unsigned int arch_align_power;
42
1.58k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.58k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.58k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.58k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.58k
  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.58k
  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.58k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.58k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.58k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.58k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.58k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.58k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.58k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.58k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.58k
  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.58k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.58k
#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.58k
  obj_textsec (abfd)->reloc_count =
97
1.58k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.58k
  obj_datasec (abfd)->reloc_count =
99
1.58k
    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.58k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.58k
  arch_align = 1 << arch_align_power;
109
1.58k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.58k
       == obj_textsec (abfd)->size)
111
847
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
847
    == obj_datasec (abfd)->size)
113
492
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
492
    == 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
1.58k
  return _bfd_no_cleanup;
125
1.58k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_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
964
    {
58
964
      bfd_vma adjust;
59
60
964
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
964
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
964
      obj_textsec (abfd)->vma += adjust;
64
964
      obj_datasec (abfd)->vma += adjust;
65
964
      obj_bsssec (abfd)->vma += adjust;
66
964
    }
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
780
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
780
    == obj_datasec (abfd)->size)
113
409
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
409
    == obj_bsssec (abfd)->size))
115
139
    {
116
139
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
139
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
139
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
139
    }
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
}
pc532-mach.c:ns32k_aout_pc532mach_callback
Line
Count
Source
39
1.58k
{
40
1.58k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.58k
  unsigned int arch_align_power;
42
1.58k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.58k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.58k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.58k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.58k
  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.58k
  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.58k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.58k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.58k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.58k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.58k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.58k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.58k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.58k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.58k
  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.58k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.58k
#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.58k
  obj_textsec (abfd)->reloc_count =
97
1.58k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.58k
  obj_datasec (abfd)->reloc_count =
99
1.58k
    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.58k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.58k
  arch_align = 1 << arch_align_power;
109
1.58k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.58k
       == obj_textsec (abfd)->size)
111
842
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
842
    == obj_datasec (abfd)->size)
113
487
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
487
    == obj_bsssec (abfd)->size))
115
160
    {
116
160
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
160
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
160
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
160
    }
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.58k
  return _bfd_no_cleanup;
125
1.58k
}
pdp11.c:pdp11_aout_callback
Line
Count
Source
39
2.21k
{
40
2.21k
  struct internal_exec *execp = exec_hdr (abfd);
41
2.21k
  unsigned int arch_align_power;
42
2.21k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
2.21k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
2.21k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
2.21k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
2.21k
  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
2.21k
  if (aout_backend_info (abfd)->entry_is_text_address
56
2.21k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
1.44k
    {
58
1.44k
      bfd_vma adjust;
59
60
1.44k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
1.44k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
1.44k
      obj_textsec (abfd)->vma += adjust;
64
1.44k
      obj_datasec (abfd)->vma += adjust;
65
1.44k
      obj_bsssec (abfd)->vma += adjust;
66
1.44k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
2.21k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
2.21k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
2.21k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
2.21k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
2.21k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
2.21k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
2.21k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
2.21k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
2.21k
  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
2.21k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
2.21k
#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
2.21k
  obj_textsec (abfd)->reloc_count =
97
2.21k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
2.21k
  obj_datasec (abfd)->reloc_count =
99
2.21k
    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
2.21k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
2.21k
  arch_align = 1 << arch_align_power;
109
2.21k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
2.21k
       == obj_textsec (abfd)->size)
111
1.17k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
1.17k
    == obj_datasec (abfd)->size)
113
941
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
941
    == obj_bsssec (abfd)->size))
115
485
    {
116
485
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
485
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
485
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
485
    }
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
2.21k
  return _bfd_no_cleanup;
125
2.21k
}
vax1knetbsd.c:vax_aout_1knbsd_callback
Line
Count
Source
39
1.06k
{
40
1.06k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.06k
  unsigned int arch_align_power;
42
1.06k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.06k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.06k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.06k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.06k
  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.06k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.06k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
833
    {
58
833
      bfd_vma adjust;
59
60
833
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
833
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
833
      obj_textsec (abfd)->vma += adjust;
64
833
      obj_datasec (abfd)->vma += adjust;
65
833
      obj_bsssec (abfd)->vma += adjust;
66
833
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.06k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.06k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.06k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.06k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.06k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.06k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.06k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.06k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.06k
  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.06k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.06k
#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.06k
  obj_textsec (abfd)->reloc_count =
97
1.06k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.06k
  obj_datasec (abfd)->reloc_count =
99
1.06k
    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.06k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.06k
  arch_align = 1 << arch_align_power;
109
1.06k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.06k
       == obj_textsec (abfd)->size)
111
669
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
669
    == obj_datasec (abfd)->size)
113
403
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
403
    == obj_bsssec (abfd)->size))
115
181
    {
116
181
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
181
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
181
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
181
    }
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.06k
  return _bfd_no_cleanup;
125
1.06k
}
vaxnetbsd.c:vax_aout_nbsd_callback
Line
Count
Source
39
871
{
40
871
  struct internal_exec *execp = exec_hdr (abfd);
41
871
  unsigned int arch_align_power;
42
871
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
871
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
871
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
871
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
871
  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
871
  if (aout_backend_info (abfd)->entry_is_text_address
56
871
      && execp->a_entry > obj_textsec (abfd)->vma)
57
715
    {
58
715
      bfd_vma adjust;
59
60
715
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
715
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
715
      obj_textsec (abfd)->vma += adjust;
64
715
      obj_datasec (abfd)->vma += adjust;
65
715
      obj_bsssec (abfd)->vma += adjust;
66
715
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
871
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
871
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
871
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
871
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
871
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
871
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
871
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
871
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
871
  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
871
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
871
#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
871
  obj_textsec (abfd)->reloc_count =
97
871
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
871
  obj_datasec (abfd)->reloc_count =
99
871
    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
871
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
871
  arch_align = 1 << arch_align_power;
109
871
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
871
       == obj_textsec (abfd)->size)
111
597
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
597
    == obj_datasec (abfd)->size)
113
316
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
316
    == 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
871
  return _bfd_no_cleanup;
125
871
}
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.71M
{
134
1.71M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
1.71M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
1.71M
  bfd_cleanup cleanup;
137
1.71M
  size_t amt = EXEC_BYTES_SIZE;
138
139
1.71M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
99.0k
    {
141
99.0k
      if (bfd_get_error () != bfd_error_system_call)
142
97.5k
  bfd_set_error (bfd_error_wrong_format);
143
99.0k
      return 0;
144
99.0k
    }
145
146
#ifdef SWAP_MAGIC
147
721k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
895k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
#endif
151
152
1.61M
  if (N_BADMAG (&exec))
153
1.59M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
12.7k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
8.10k
    return 0;
158
4.69k
#endif
159
160
11.6k
  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
5.46k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
#endif
166
167
11.6k
  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
850
  if (exec.a_trsize + exec.a_drsize == 0
177
133
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
8
    {
179
8
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
8
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
8
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
8
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
11.6k
  return cleanup;
190
12.7k
}
aout-cris.c:cris_aout_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.8k
    {
141
11.8k
      if (bfd_get_error () != bfd_error_system_call)
142
11.6k
  bfd_set_error (bfd_error_wrong_format);
143
11.8k
      return 0;
144
11.8k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
179k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
179k
#endif
151
152
179k
  if (N_BADMAG (&exec))
153
177k
    return 0;
154
155
1.58k
#ifdef MACHTYPE_OK
156
1.58k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
739
    return 0;
158
850
#endif
159
160
850
  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
850
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
850
#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
850
  if (exec.a_trsize + exec.a_drsize == 0
177
133
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
8
    {
179
8
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
8
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
8
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
8
    }
187
850
#endif /* ENTRY_CAN_BE_ZERO */
188
189
850
  return cleanup;
190
1.58k
}
i386aout.c:i386_aout_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.8k
    {
141
11.8k
      if (bfd_get_error () != bfd_error_system_call)
142
11.6k
  bfd_set_error (bfd_error_wrong_format);
143
11.8k
      return 0;
144
11.8k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
179k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
179k
#endif
151
152
179k
  if (N_BADMAG (&exec))
153
177k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.58k
  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.58k
  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.58k
  return cleanup;
190
179k
}
i386bsd.c:i386_aout_bsd_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.8k
    {
141
11.8k
      if (bfd_get_error () != bfd_error_system_call)
142
11.6k
  bfd_set_error (bfd_error_wrong_format);
143
11.8k
      return 0;
144
11.8k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
179k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
179k
#endif
151
152
179k
  if (N_BADMAG (&exec))
153
177k
    return 0;
154
155
1.58k
#ifdef MACHTYPE_OK
156
1.58k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
994
    return 0;
158
595
#endif
159
160
595
  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
595
  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
595
  return cleanup;
190
1.58k
}
i386lynx.c:i386_aout_lynx_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.8k
    {
141
11.8k
      if (bfd_get_error () != bfd_error_system_call)
142
11.6k
  bfd_set_error (bfd_error_wrong_format);
143
11.8k
      return 0;
144
11.8k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
179k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
179k
#endif
151
152
179k
  if (N_BADMAG (&exec))
153
177k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.58k
  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.58k
  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.58k
  return cleanup;
190
179k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.9k
    {
141
11.9k
      if (bfd_get_error () != bfd_error_system_call)
142
11.7k
  bfd_set_error (bfd_error_wrong_format);
143
11.9k
      return 0;
144
11.9k
    }
145
146
179k
#ifdef SWAP_MAGIC
147
179k
  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
179k
  if (N_BADMAG (&exec))
153
175k
    return 0;
154
155
3.23k
#ifdef MACHTYPE_OK
156
3.23k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.92k
    return 0;
158
1.31k
#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
3.23k
}
pc532-mach.c:ns32k_aout_pc532mach_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.9k
    {
141
11.9k
      if (bfd_get_error () != bfd_error_system_call)
142
11.7k
  bfd_set_error (bfd_error_wrong_format);
143
11.9k
      return 0;
144
11.9k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
179k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
179k
#endif
151
152
179k
  if (N_BADMAG (&exec))
153
177k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
1.58k
  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.58k
  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.58k
  return cleanup;
190
179k
}
pdp11.c:pdp11_aout_object_p
Line
Count
Source
133
188k
{
134
188k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
188k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
188k
  bfd_cleanup cleanup;
137
188k
  size_t amt = EXEC_BYTES_SIZE;
138
139
188k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
4.00k
    {
141
4.00k
      if (bfd_get_error () != bfd_error_system_call)
142
3.83k
  bfd_set_error (bfd_error_wrong_format);
143
4.00k
      return 0;
144
4.00k
    }
145
146
184k
#ifdef SWAP_MAGIC
147
184k
  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
184k
  if (N_BADMAG (&exec))
153
182k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
2.21k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
2.21k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
2.21k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
2.21k
#endif
166
167
2.21k
  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
2.21k
  return cleanup;
190
184k
}
vax1knetbsd.c:vax_aout_1knbsd_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.9k
    {
141
11.9k
      if (bfd_get_error () != bfd_error_system_call)
142
11.7k
  bfd_set_error (bfd_error_wrong_format);
143
11.9k
      return 0;
144
11.9k
    }
145
146
179k
#ifdef SWAP_MAGIC
147
179k
  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
179k
  if (N_BADMAG (&exec))
153
175k
    return 0;
154
155
3.18k
#ifdef MACHTYPE_OK
156
3.18k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
2.12k
    return 0;
158
1.06k
#endif
159
160
1.06k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.06k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.06k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.06k
#endif
166
167
1.06k
  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.06k
  return cleanup;
190
3.18k
}
vaxnetbsd.c:vax_aout_nbsd_object_p
Line
Count
Source
133
190k
{
134
190k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
190k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
190k
  bfd_cleanup cleanup;
137
190k
  size_t amt = EXEC_BYTES_SIZE;
138
139
190k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
11.9k
    {
141
11.9k
      if (bfd_get_error () != bfd_error_system_call)
142
11.7k
  bfd_set_error (bfd_error_wrong_format);
143
11.9k
      return 0;
144
11.9k
    }
145
146
179k
#ifdef SWAP_MAGIC
147
179k
  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
179k
  if (N_BADMAG (&exec))
153
175k
    return 0;
154
155
3.18k
#ifdef MACHTYPE_OK
156
3.18k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
2.31k
    return 0;
158
871
#endif
159
160
871
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
871
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
871
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
871
#endif
166
167
871
  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
871
  return cleanup;
190
3.18k
}
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
98
{
199
98
  return NAME (aout, mkobject (abfd));
200
98
}
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
29
{
199
29
  return NAME (aout, mkobject (abfd));
200
29
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_mkobject
pdp11.c:pdp11_aout_mkobject
Line
Count
Source
198
54
{
199
54
  return NAME (aout, mkobject (abfd));
200
54
}
vax1knetbsd.c:vax_aout_1knbsd_mkobject
Line
Count
Source
198
12
{
199
12
  return NAME (aout, mkobject (abfd));
200
12
}
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
99
{
220
99
  if (link_info == NULL
221
99
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
99
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
99
  return true;
224
99
}
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
36
{
220
36
  if (link_info == NULL
221
36
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
36
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
36
}
Unexecuted instantiation: pc532-mach.c:MY_bfd_copy_private_section_data
pdp11.c:MY_bfd_copy_private_section_data
Line
Count
Source
219
45
{
220
45
  if (link_info == NULL
221
45
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
45
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
45
}
vax1knetbsd.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
}
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
98
{
254
98
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
98
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
98
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
98
  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
98
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
98
  return true;
265
98
}
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
29
{
254
29
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
29
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
29
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
29
  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
29
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
29
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_set_sizes
pdp11.c:pdp11_aout_set_sizes
Line
Count
Source
253
54
{
254
54
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
54
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
54
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
54
  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
54
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
54
}
vax1knetbsd.c:vax_aout_1knbsd_set_sizes
Line
Count
Source
253
12
{
254
12
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
12
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
12
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
12
  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
12
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
12
}
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 */