Coverage Report

Created: 2025-06-24 06:45

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