Coverage Report

Created: 2025-07-08 11:15

/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
91.1k
#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
109k
{
40
109k
  struct internal_exec *execp = exec_hdr (abfd);
41
109k
  unsigned int arch_align_power;
42
109k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
109k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
109k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
109k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
109k
  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
109k
  if (aout_backend_info (abfd)->entry_is_text_address
56
109k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
37.1k
    {
58
37.1k
      bfd_vma adjust;
59
60
37.1k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
37.1k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
37.1k
      obj_textsec (abfd)->vma += adjust;
64
37.1k
      obj_datasec (abfd)->vma += adjust;
65
37.1k
      obj_bsssec (abfd)->vma += adjust;
66
37.1k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
109k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
109k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
109k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
109k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
109k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
109k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
109k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
109k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
109k
  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.04k
  SET_ARCH_MACH (abfd, execp);
88
#else
89
104k
  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
109k
  obj_textsec (abfd)->reloc_count =
97
109k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
109k
  obj_datasec (abfd)->reloc_count =
99
109k
    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
109k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
109k
  arch_align = 1 << arch_align_power;
109
109k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
109k
       == obj_textsec (abfd)->size)
111
109k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
69.3k
    == obj_datasec (abfd)->size)
113
109k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
47.0k
    == obj_bsssec (abfd)->size))
115
26.3k
    {
116
26.3k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
26.3k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
26.3k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
26.3k
    }
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
109k
  return _bfd_no_cleanup;
125
109k
}
aout-cris.c:cris_aout_callback
Line
Count
Source
39
5.04k
{
40
5.04k
  struct internal_exec *execp = exec_hdr (abfd);
41
5.04k
  unsigned int arch_align_power;
42
5.04k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
5.04k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
5.04k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
5.04k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
5.04k
  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.04k
  if (aout_backend_info (abfd)->entry_is_text_address
56
5.04k
      && 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.04k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
5.04k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
5.04k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
5.04k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
5.04k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
5.04k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
5.04k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
5.04k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
5.04k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
5.04k
#ifdef SET_ARCH_MACH
87
5.04k
  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.04k
  obj_textsec (abfd)->reloc_count =
97
5.04k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
5.04k
  obj_datasec (abfd)->reloc_count =
99
5.04k
    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.04k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
5.04k
  arch_align = 1 << arch_align_power;
109
5.04k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
5.04k
       == obj_textsec (abfd)->size)
111
5.04k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
3.09k
    == obj_datasec (abfd)->size)
113
5.04k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
1.98k
    == obj_bsssec (abfd)->size))
115
1.07k
    {
116
1.07k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.07k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.07k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.07k
    }
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.04k
  return _bfd_no_cleanup;
125
5.04k
}
i386aout.c:i386_aout_callback
Line
Count
Source
39
12.5k
{
40
12.5k
  struct internal_exec *execp = exec_hdr (abfd);
41
12.5k
  unsigned int arch_align_power;
42
12.5k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
12.5k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
12.5k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
12.5k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
12.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
12.5k
  if (aout_backend_info (abfd)->entry_is_text_address
56
12.5k
      && 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.5k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
12.5k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
12.5k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
12.5k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
12.5k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
12.5k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
12.5k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
12.5k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
12.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
12.5k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
12.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
12.5k
  obj_textsec (abfd)->reloc_count =
97
12.5k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
12.5k
  obj_datasec (abfd)->reloc_count =
99
12.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
12.5k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
12.5k
  arch_align = 1 << arch_align_power;
109
12.5k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
12.5k
       == obj_textsec (abfd)->size)
111
12.5k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
7.69k
    == obj_datasec (abfd)->size)
113
12.5k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.49k
    == obj_bsssec (abfd)->size))
115
2.35k
    {
116
2.35k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
2.35k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
2.35k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
2.35k
    }
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.5k
  return _bfd_no_cleanup;
125
12.5k
}
i386bsd.c:i386_aout_bsd_callback
Line
Count
Source
39
5.63k
{
40
5.63k
  struct internal_exec *execp = exec_hdr (abfd);
41
5.63k
  unsigned int arch_align_power;
42
5.63k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
5.63k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
5.63k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
5.63k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
5.63k
  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.63k
  if (aout_backend_info (abfd)->entry_is_text_address
56
5.63k
      && 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.63k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
5.63k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
5.63k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
5.63k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
5.63k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
5.63k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
5.63k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
5.63k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
5.63k
  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.63k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
5.63k
#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.63k
  obj_textsec (abfd)->reloc_count =
97
5.63k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
5.63k
  obj_datasec (abfd)->reloc_count =
99
5.63k
    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.63k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
5.63k
  arch_align = 1 << arch_align_power;
109
5.63k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
5.63k
       == obj_textsec (abfd)->size)
111
5.63k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
3.94k
    == obj_datasec (abfd)->size)
113
5.63k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
2.43k
    == obj_bsssec (abfd)->size))
115
1.31k
    {
116
1.31k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.31k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.31k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.31k
    }
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.63k
  return _bfd_no_cleanup;
125
5.63k
}
i386lynx.c:i386_aout_lynx_callback
Line
Count
Source
39
12.5k
{
40
12.5k
  struct internal_exec *execp = exec_hdr (abfd);
41
12.5k
  unsigned int arch_align_power;
42
12.5k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
12.5k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
12.5k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
12.5k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
12.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
12.5k
  if (aout_backend_info (abfd)->entry_is_text_address
56
12.5k
      && 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.5k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
12.5k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
12.5k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
12.5k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
12.5k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
12.5k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
12.5k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
12.5k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
12.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
12.5k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
12.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
12.5k
  obj_textsec (abfd)->reloc_count =
97
12.5k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
12.5k
  obj_datasec (abfd)->reloc_count =
99
12.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
12.5k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
12.5k
  arch_align = 1 << arch_align_power;
109
12.5k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
12.5k
       == obj_textsec (abfd)->size)
111
12.5k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
7.79k
    == obj_datasec (abfd)->size)
113
12.5k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.49k
    == obj_bsssec (abfd)->size))
115
2.35k
    {
116
2.35k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
2.35k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
2.35k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
2.35k
    }
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.5k
  return _bfd_no_cleanup;
125
12.5k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_callback
Line
Count
Source
39
9.67k
{
40
9.67k
  struct internal_exec *execp = exec_hdr (abfd);
41
9.67k
  unsigned int arch_align_power;
42
9.67k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
9.67k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
9.67k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
9.67k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
9.67k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
9.67k
  if (aout_backend_info (abfd)->entry_is_text_address
56
9.67k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
4.52k
    {
58
4.52k
      bfd_vma adjust;
59
60
4.52k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
4.52k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
4.52k
      obj_textsec (abfd)->vma += adjust;
64
4.52k
      obj_datasec (abfd)->vma += adjust;
65
4.52k
      obj_bsssec (abfd)->vma += adjust;
66
4.52k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
9.67k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
9.67k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
9.67k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
9.67k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
9.67k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
9.67k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
9.67k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
9.67k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
9.67k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
9.67k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
9.67k
#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.67k
  obj_textsec (abfd)->reloc_count =
97
9.67k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
9.67k
  obj_datasec (abfd)->reloc_count =
99
9.67k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
9.67k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
9.67k
  arch_align = 1 << arch_align_power;
109
9.67k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
9.67k
       == obj_textsec (abfd)->size)
111
9.67k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
5.30k
    == obj_datasec (abfd)->size)
113
9.67k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.03k
    == obj_bsssec (abfd)->size))
115
2.19k
    {
116
2.19k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
2.19k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
2.19k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
2.19k
    }
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.67k
  return _bfd_no_cleanup;
125
9.67k
}
pc532-mach.c:ns32k_aout_pc532mach_callback
Line
Count
Source
39
12.5k
{
40
12.5k
  struct internal_exec *execp = exec_hdr (abfd);
41
12.5k
  unsigned int arch_align_power;
42
12.5k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
12.5k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
12.5k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
12.5k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
12.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
12.5k
  if (aout_backend_info (abfd)->entry_is_text_address
56
12.5k
      && 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.5k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
12.5k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
12.5k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
12.5k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
12.5k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
12.5k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
12.5k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
12.5k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
12.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
12.5k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
12.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
12.5k
  obj_textsec (abfd)->reloc_count =
97
12.5k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
12.5k
  obj_datasec (abfd)->reloc_count =
99
12.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
12.5k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
12.5k
  arch_align = 1 << arch_align_power;
109
12.5k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
12.5k
       == obj_textsec (abfd)->size)
111
12.5k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
7.69k
    == obj_datasec (abfd)->size)
113
12.5k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.49k
    == obj_bsssec (abfd)->size))
115
2.35k
    {
116
2.35k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
2.35k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
2.35k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
2.35k
    }
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.5k
  return _bfd_no_cleanup;
125
12.5k
}
pdp11.c:pdp11_aout_callback
Line
Count
Source
39
35.7k
{
40
35.7k
  struct internal_exec *execp = exec_hdr (abfd);
41
35.7k
  unsigned int arch_align_power;
42
35.7k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
35.7k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
35.7k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
35.7k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
35.7k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
35.7k
  if (aout_backend_info (abfd)->entry_is_text_address
56
35.7k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
21.8k
    {
58
21.8k
      bfd_vma adjust;
59
60
21.8k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
21.8k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
21.8k
      obj_textsec (abfd)->vma += adjust;
64
21.8k
      obj_datasec (abfd)->vma += adjust;
65
21.8k
      obj_bsssec (abfd)->vma += adjust;
66
21.8k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
35.7k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
35.7k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
35.7k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
35.7k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
35.7k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
35.7k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
35.7k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
35.7k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
35.7k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
35.7k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
35.7k
#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
35.7k
  obj_textsec (abfd)->reloc_count =
97
35.7k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
35.7k
  obj_datasec (abfd)->reloc_count =
99
35.7k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
35.7k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
35.7k
  arch_align = 1 << arch_align_power;
109
35.7k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
35.7k
       == obj_textsec (abfd)->size)
111
35.7k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
22.0k
    == obj_datasec (abfd)->size)
113
35.7k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
17.0k
    == obj_bsssec (abfd)->size))
115
11.5k
    {
116
11.5k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
11.5k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
11.5k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
11.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
35.7k
  return _bfd_no_cleanup;
125
35.7k
}
vax1knetbsd.c:vax_aout_1knbsd_callback
Line
Count
Source
39
8.38k
{
40
8.38k
  struct internal_exec *execp = exec_hdr (abfd);
41
8.38k
  unsigned int arch_align_power;
42
8.38k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
8.38k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
8.38k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
8.38k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
8.38k
  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.38k
  if (aout_backend_info (abfd)->entry_is_text_address
56
8.38k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
5.75k
    {
58
5.75k
      bfd_vma adjust;
59
60
5.75k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
5.75k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
5.75k
      obj_textsec (abfd)->vma += adjust;
64
5.75k
      obj_datasec (abfd)->vma += adjust;
65
5.75k
      obj_bsssec (abfd)->vma += adjust;
66
5.75k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
8.38k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
8.38k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
8.38k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
8.38k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
8.38k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
8.38k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
8.38k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
8.38k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
8.38k
  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.38k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
8.38k
#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.38k
  obj_textsec (abfd)->reloc_count =
97
8.38k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
8.38k
  obj_datasec (abfd)->reloc_count =
99
8.38k
    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.38k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
8.38k
  arch_align = 1 << arch_align_power;
109
8.38k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
8.38k
       == obj_textsec (abfd)->size)
111
8.38k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
6.10k
    == obj_datasec (abfd)->size)
113
8.38k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
4.45k
    == obj_bsssec (abfd)->size))
115
1.57k
    {
116
1.57k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.57k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.57k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.57k
    }
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.38k
  return _bfd_no_cleanup;
125
8.38k
}
vaxnetbsd.c:vax_aout_nbsd_callback
Line
Count
Source
39
7.74k
{
40
7.74k
  struct internal_exec *execp = exec_hdr (abfd);
41
7.74k
  unsigned int arch_align_power;
42
7.74k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
7.74k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
7.74k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
7.74k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
7.74k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
7.74k
  if (aout_backend_info (abfd)->entry_is_text_address
56
7.74k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
4.95k
    {
58
4.95k
      bfd_vma adjust;
59
60
4.95k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
4.95k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
4.95k
      obj_textsec (abfd)->vma += adjust;
64
4.95k
      obj_datasec (abfd)->vma += adjust;
65
4.95k
      obj_bsssec (abfd)->vma += adjust;
66
4.95k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
7.74k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
7.74k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
7.74k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
7.74k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
7.74k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
7.74k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
7.74k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
7.74k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
7.74k
  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
7.74k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
7.74k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
7.74k
  obj_textsec (abfd)->reloc_count =
97
7.74k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
7.74k
  obj_datasec (abfd)->reloc_count =
99
7.74k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
7.74k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
7.74k
  arch_align = 1 << arch_align_power;
109
7.74k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
7.74k
       == obj_textsec (abfd)->size)
111
7.74k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
5.64k
    == obj_datasec (abfd)->size)
113
7.74k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
3.55k
    == obj_bsssec (abfd)->size))
115
1.56k
    {
116
1.56k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
1.56k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
1.56k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
1.56k
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
7.74k
  return _bfd_no_cleanup;
125
7.74k
}
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
25.0M
{
134
25.0M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
25.0M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
25.0M
  bfd_cleanup cleanup;
137
25.0M
  size_t amt = EXEC_BYTES_SIZE;
138
139
25.0M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
1.13M
    {
141
1.13M
      if (bfd_get_error () != bfd_error_system_call)
142
1.12M
  bfd_set_error (bfd_error_wrong_format);
143
1.13M
      return 0;
144
1.13M
    }
145
146
#ifdef SWAP_MAGIC
147
10.6M
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
13.2M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
#endif
151
152
23.9M
  if (N_BADMAG (&exec))
153
23.7M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
129k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
92.7k
    return 0;
158
36.4k
#endif
159
160
109k
  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
61.5k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
#endif
166
167
109k
  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.04k
  if (exec.a_trsize + exec.a_drsize == 0
177
5.04k
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
9
    {
179
9
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
9
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
9
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
9
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
109k
  return cleanup;
190
129k
}
aout-cris.c:cris_aout_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
139k
    {
141
139k
      if (bfd_get_error () != bfd_error_system_call)
142
138k
  bfd_set_error (bfd_error_wrong_format);
143
139k
      return 0;
144
139k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
2.64M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
2.64M
#endif
151
152
2.64M
  if (N_BADMAG (&exec))
153
2.63M
    return 0;
154
155
12.5k
#ifdef MACHTYPE_OK
156
12.5k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
7.48k
    return 0;
158
5.04k
#endif
159
160
5.04k
  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.04k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
5.04k
#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.04k
  if (exec.a_trsize + exec.a_drsize == 0
177
5.04k
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
9
    {
179
9
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
9
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
9
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
9
    }
187
5.04k
#endif /* ENTRY_CAN_BE_ZERO */
188
189
5.04k
  return cleanup;
190
12.5k
}
i386aout.c:i386_aout_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
139k
    {
141
139k
      if (bfd_get_error () != bfd_error_system_call)
142
138k
  bfd_set_error (bfd_error_wrong_format);
143
139k
      return 0;
144
139k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
2.64M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
2.64M
#endif
151
152
2.64M
  if (N_BADMAG (&exec))
153
2.63M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
12.5k
  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.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
12.5k
  return cleanup;
190
2.64M
}
i386bsd.c:i386_aout_bsd_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
139k
    {
141
139k
      if (bfd_get_error () != bfd_error_system_call)
142
138k
  bfd_set_error (bfd_error_wrong_format);
143
139k
      return 0;
144
139k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
2.64M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
2.64M
#endif
151
152
2.64M
  if (N_BADMAG (&exec))
153
2.63M
    return 0;
154
155
12.5k
#ifdef MACHTYPE_OK
156
12.5k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
6.90k
    return 0;
158
5.63k
#endif
159
160
5.63k
  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.63k
  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.63k
  return cleanup;
190
12.5k
}
i386lynx.c:i386_aout_lynx_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
139k
    {
141
139k
      if (bfd_get_error () != bfd_error_system_call)
142
138k
  bfd_set_error (bfd_error_wrong_format);
143
139k
      return 0;
144
139k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
2.64M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
2.64M
#endif
151
152
2.64M
  if (N_BADMAG (&exec))
153
2.63M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
12.5k
  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.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
12.5k
  return cleanup;
190
2.64M
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
138k
    {
141
138k
      if (bfd_get_error () != bfd_error_system_call)
142
137k
  bfd_set_error (bfd_error_wrong_format);
143
138k
      return 0;
144
138k
    }
145
146
2.64M
#ifdef SWAP_MAGIC
147
2.64M
  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
2.64M
  if (N_BADMAG (&exec))
153
2.60M
    return 0;
154
155
34.7k
#ifdef MACHTYPE_OK
156
34.7k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
25.0k
    return 0;
158
9.67k
#endif
159
160
9.67k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
9.67k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
9.67k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
9.67k
#endif
166
167
9.67k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  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.67k
  return cleanup;
190
34.7k
}
pc532-mach.c:ns32k_aout_pc532mach_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
138k
    {
141
138k
      if (bfd_get_error () != bfd_error_system_call)
142
137k
  bfd_set_error (bfd_error_wrong_format);
143
138k
      return 0;
144
138k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
2.64M
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
2.64M
#endif
151
152
2.64M
  if (N_BADMAG (&exec))
153
2.63M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
12.5k
  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.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
12.5k
  return cleanup;
190
2.64M
}
pdp11.c:pdp11_aout_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
30.5k
    {
141
30.5k
      if (bfd_get_error () != bfd_error_system_call)
142
29.7k
  bfd_set_error (bfd_error_wrong_format);
143
30.5k
      return 0;
144
30.5k
    }
145
146
2.75M
#ifdef SWAP_MAGIC
147
2.75M
  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
2.75M
  if (N_BADMAG (&exec))
153
2.71M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
35.7k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
35.7k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
35.7k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
35.7k
#endif
166
167
35.7k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  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
35.7k
  return cleanup;
190
2.75M
}
vax1knetbsd.c:vax_aout_1knbsd_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
135k
    {
141
135k
      if (bfd_get_error () != bfd_error_system_call)
142
135k
  bfd_set_error (bfd_error_wrong_format);
143
135k
      return 0;
144
135k
    }
145
146
2.64M
#ifdef SWAP_MAGIC
147
2.64M
  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
2.64M
  if (N_BADMAG (&exec))
153
2.61M
    return 0;
154
155
34.7k
#ifdef MACHTYPE_OK
156
34.7k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
26.3k
    return 0;
158
8.38k
#endif
159
160
8.38k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
8.38k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
8.38k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
8.38k
#endif
166
167
8.38k
  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.38k
  return cleanup;
190
34.7k
}
vaxnetbsd.c:vax_aout_nbsd_object_p
Line
Count
Source
133
2.78M
{
134
2.78M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
2.78M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
2.78M
  bfd_cleanup cleanup;
137
2.78M
  size_t amt = EXEC_BYTES_SIZE;
138
139
2.78M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
135k
    {
141
135k
      if (bfd_get_error () != bfd_error_system_call)
142
135k
  bfd_set_error (bfd_error_wrong_format);
143
135k
      return 0;
144
135k
    }
145
146
2.64M
#ifdef SWAP_MAGIC
147
2.64M
  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
2.64M
  if (N_BADMAG (&exec))
153
2.61M
    return 0;
154
155
34.7k
#ifdef MACHTYPE_OK
156
34.7k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
26.9k
    return 0;
158
7.74k
#endif
159
160
7.74k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
7.74k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
7.74k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
7.74k
#endif
166
167
7.74k
  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
7.74k
  return cleanup;
190
34.7k
}
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
13
{
199
13
  return NAME (aout, mkobject (abfd));
200
13
}
Unexecuted instantiation: aout-cris.c:cris_aout_mkobject
Unexecuted instantiation: i386aout.c:i386_aout_mkobject
Unexecuted instantiation: i386bsd.c:i386_aout_bsd_mkobject
Unexecuted instantiation: i386lynx.c:i386_aout_lynx_mkobject
Unexecuted instantiation: ns32knetbsd.c:ns32k_aout_pc532nbsd_mkobject
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_mkobject
pdp11.c:pdp11_aout_mkobject
Line
Count
Source
198
12
{
199
12
  return NAME (aout, mkobject (abfd));
200
12
}
Unexecuted instantiation: vax1knetbsd.c:vax_aout_1knbsd_mkobject
vaxnetbsd.c:vax_aout_nbsd_mkobject
Line
Count
Source
198
1
{
199
1
  return NAME (aout, mkobject (abfd));
200
1
}
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
18
{
219
18
  if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour
220
18
      && bfd_get_flavour (obfd) == bfd_target_aout_flavour)
221
18
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
222
18
  return true;
223
18
}
Unexecuted instantiation: aout-cris.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386aout.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386bsd.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386lynx.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: ns32knetbsd.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: pc532-mach.c:MY_bfd_copy_private_section_data
pdp11.c:MY_bfd_copy_private_section_data
Line
Count
Source
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: vax1knetbsd.c:MY_bfd_copy_private_section_data
vaxnetbsd.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
}
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
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: i386aout.c:i386_aout_set_sizes
Unexecuted instantiation: i386bsd.c:i386_aout_bsd_set_sizes
Unexecuted instantiation: i386lynx.c:i386_aout_lynx_set_sizes
Unexecuted instantiation: ns32knetbsd.c:ns32k_aout_pc532nbsd_set_sizes
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_set_sizes
pdp11.c:pdp11_aout_set_sizes
Line
Count
Source
252
12
{
253
12
  adata(abfd).page_size = TARGET_PAGE_SIZE;
254
12
  adata(abfd).segment_size = SEGMENT_SIZE;
255
256
12
#ifdef ZMAGIC_DISK_BLOCK_SIZE
257
12
  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
12
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
263
12
  return true;
264
12
}
Unexecuted instantiation: vax1knetbsd.c:vax_aout_1knbsd_set_sizes
vaxnetbsd.c:vax_aout_nbsd_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
}
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 */