Coverage Report

Created: 2026-07-12 09:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/binutils-gdb/bfd/aout-target.h
Line
Count
Source
1
/* Define a target vector and some small routines for a variant of a.out.
2
   Copyright (C) 1990-2026 Free Software Foundation, Inc.
3
4
   This file is part of BFD, the Binary File Descriptor library.
5
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 3 of the License, or
9
   (at your option) any later version.
10
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19
   MA 02110-1301, USA.  */
20
21
#include "aout/aout64.h"
22
#include "aout/stab_gnu.h"
23
#include "aout/ar.h"
24
/*#include "libaout.h"*/
25
26
#ifndef SEGMENT_SIZE
27
6.38k
#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
14.3k
{
40
14.3k
  struct internal_exec *execp = exec_hdr (abfd);
41
14.3k
  unsigned int arch_align_power;
42
14.3k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
14.3k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
14.3k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
14.3k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
14.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
14.3k
  if (aout_backend_info (abfd)->entry_is_text_address
56
6.49k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
4.71k
    {
58
4.71k
      bfd_vma adjust;
59
60
4.71k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
4.71k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
4.71k
      obj_textsec (abfd)->vma += adjust;
64
4.71k
      obj_datasec (abfd)->vma += adjust;
65
4.71k
      obj_bsssec (abfd)->vma += adjust;
66
4.71k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
14.3k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
14.3k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
14.3k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
14.3k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
14.3k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
14.3k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
14.3k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
14.3k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
14.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
1.06k
  SET_ARCH_MACH (abfd, execp);
88
#else
89
13.3k
  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
14.3k
  obj_textsec (abfd)->reloc_count =
97
14.3k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
14.3k
  obj_datasec (abfd)->reloc_count =
99
14.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
14.3k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
14.3k
  arch_align = 1 << arch_align_power;
109
14.3k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
14.3k
       == obj_textsec (abfd)->size)
111
8.53k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
8.53k
    == obj_datasec (abfd)->size)
113
5.45k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
5.45k
    == obj_bsssec (abfd)->size))
115
2.37k
    {
116
2.37k
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
2.37k
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
2.37k
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
2.37k
    }
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
14.3k
  return _bfd_no_cleanup;
125
14.3k
}
aout-cris.c:cris_aout_callback
Line
Count
Source
39
1.06k
{
40
1.06k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.06k
  unsigned int arch_align_power;
42
1.06k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.06k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.06k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.06k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.06k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
1.06k
  if (aout_backend_info (abfd)->entry_is_text_address
56
0
      && execp->a_entry > obj_textsec (abfd)->vma)
57
0
    {
58
0
      bfd_vma adjust;
59
60
0
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
0
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
0
      obj_textsec (abfd)->vma += adjust;
64
0
      obj_datasec (abfd)->vma += adjust;
65
0
      obj_bsssec (abfd)->vma += adjust;
66
0
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.06k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.06k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.06k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.06k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.06k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.06k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.06k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.06k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.06k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
1.06k
#ifdef SET_ARCH_MACH
87
1.06k
  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
1.06k
  obj_textsec (abfd)->reloc_count =
97
1.06k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.06k
  obj_datasec (abfd)->reloc_count =
99
1.06k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
1.06k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.06k
  arch_align = 1 << arch_align_power;
109
1.06k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.06k
       == obj_textsec (abfd)->size)
111
642
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
642
    == obj_datasec (abfd)->size)
113
437
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
437
    == obj_bsssec (abfd)->size))
115
260
    {
116
260
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
260
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
260
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
260
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
1.06k
  return _bfd_no_cleanup;
125
1.06k
}
i386aout.c:i386_aout_callback
Line
Count
Source
39
2.03k
{
40
2.03k
  struct internal_exec *execp = exec_hdr (abfd);
41
2.03k
  unsigned int arch_align_power;
42
2.03k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
2.03k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
2.03k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
2.03k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
2.03k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
2.03k
  if (aout_backend_info (abfd)->entry_is_text_address
56
0
      && execp->a_entry > obj_textsec (abfd)->vma)
57
0
    {
58
0
      bfd_vma adjust;
59
60
0
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
0
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
0
      obj_textsec (abfd)->vma += adjust;
64
0
      obj_datasec (abfd)->vma += adjust;
65
0
      obj_bsssec (abfd)->vma += adjust;
66
0
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
2.03k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
2.03k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
2.03k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
2.03k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
2.03k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
2.03k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
2.03k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
2.03k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
2.03k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
2.03k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
2.03k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
2.03k
  obj_textsec (abfd)->reloc_count =
97
2.03k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
2.03k
  obj_datasec (abfd)->reloc_count =
99
2.03k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
2.03k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
2.03k
  arch_align = 1 << arch_align_power;
109
2.03k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
2.03k
       == obj_textsec (abfd)->size)
111
1.10k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
1.10k
    == obj_datasec (abfd)->size)
113
664
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
664
    == obj_bsssec (abfd)->size))
115
257
    {
116
257
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
257
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
257
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
257
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
2.03k
  return _bfd_no_cleanup;
125
2.03k
}
i386bsd.c:i386_aout_bsd_callback
Line
Count
Source
39
733
{
40
733
  struct internal_exec *execp = exec_hdr (abfd);
41
733
  unsigned int arch_align_power;
42
733
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
733
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
733
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
733
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
733
  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
733
  if (aout_backend_info (abfd)->entry_is_text_address
56
0
      && execp->a_entry > obj_textsec (abfd)->vma)
57
0
    {
58
0
      bfd_vma adjust;
59
60
0
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
0
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
0
      obj_textsec (abfd)->vma += adjust;
64
0
      obj_datasec (abfd)->vma += adjust;
65
0
      obj_bsssec (abfd)->vma += adjust;
66
0
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
733
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
733
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
733
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
733
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
733
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
733
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
733
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
733
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
733
  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
733
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
733
#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
733
  obj_textsec (abfd)->reloc_count =
97
733
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
733
  obj_datasec (abfd)->reloc_count =
99
733
    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
733
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
733
  arch_align = 1 << arch_align_power;
109
733
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
733
       == obj_textsec (abfd)->size)
111
556
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
556
    == obj_datasec (abfd)->size)
113
361
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
361
    == obj_bsssec (abfd)->size))
115
126
    {
116
126
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
126
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
126
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
126
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
733
  return _bfd_no_cleanup;
125
733
}
i386lynx.c:i386_aout_lynx_callback
Line
Count
Source
39
2.03k
{
40
2.03k
  struct internal_exec *execp = exec_hdr (abfd);
41
2.03k
  unsigned int arch_align_power;
42
2.03k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
2.03k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
2.03k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
2.03k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
2.03k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
2.03k
  if (aout_backend_info (abfd)->entry_is_text_address
56
0
      && execp->a_entry > obj_textsec (abfd)->vma)
57
0
    {
58
0
      bfd_vma adjust;
59
60
0
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
0
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
0
      obj_textsec (abfd)->vma += adjust;
64
0
      obj_datasec (abfd)->vma += adjust;
65
0
      obj_bsssec (abfd)->vma += adjust;
66
0
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
2.03k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
2.03k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
2.03k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
2.03k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
2.03k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
2.03k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
2.03k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
2.03k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
2.03k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
2.03k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
2.03k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
2.03k
  obj_textsec (abfd)->reloc_count =
97
2.03k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
2.03k
  obj_datasec (abfd)->reloc_count =
99
2.03k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
2.03k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
2.03k
  arch_align = 1 << arch_align_power;
109
2.03k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
2.03k
       == obj_textsec (abfd)->size)
111
1.11k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
1.11k
    == obj_datasec (abfd)->size)
113
674
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
674
    == obj_bsssec (abfd)->size))
115
265
    {
116
265
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
265
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
265
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
265
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
2.03k
  return _bfd_no_cleanup;
125
2.03k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_callback
Line
Count
Source
39
1.41k
{
40
1.41k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.41k
  unsigned int arch_align_power;
42
1.41k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.41k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.41k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.41k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.41k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
1.41k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.41k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
1.05k
    {
58
1.05k
      bfd_vma adjust;
59
60
1.05k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
1.05k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
1.05k
      obj_textsec (abfd)->vma += adjust;
64
1.05k
      obj_datasec (abfd)->vma += adjust;
65
1.05k
      obj_bsssec (abfd)->vma += adjust;
66
1.05k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.41k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.41k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.41k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.41k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.41k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.41k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.41k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.41k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.41k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
1.41k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.41k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
1.41k
  obj_textsec (abfd)->reloc_count =
97
1.41k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.41k
  obj_datasec (abfd)->reloc_count =
99
1.41k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
1.41k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.41k
  arch_align = 1 << arch_align_power;
109
1.41k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.41k
       == obj_textsec (abfd)->size)
111
906
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
906
    == obj_datasec (abfd)->size)
113
511
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
511
    == obj_bsssec (abfd)->size))
115
199
    {
116
199
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
199
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
199
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
199
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
1.41k
  return _bfd_no_cleanup;
125
1.41k
}
pc532-mach.c:ns32k_aout_pc532mach_callback
Line
Count
Source
39
2.03k
{
40
2.03k
  struct internal_exec *execp = exec_hdr (abfd);
41
2.03k
  unsigned int arch_align_power;
42
2.03k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
2.03k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
2.03k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
2.03k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
2.03k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
2.03k
  if (aout_backend_info (abfd)->entry_is_text_address
56
0
      && execp->a_entry > obj_textsec (abfd)->vma)
57
0
    {
58
0
      bfd_vma adjust;
59
60
0
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
0
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
0
      obj_textsec (abfd)->vma += adjust;
64
0
      obj_datasec (abfd)->vma += adjust;
65
0
      obj_bsssec (abfd)->vma += adjust;
66
0
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
2.03k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
2.03k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
2.03k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
2.03k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
2.03k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
2.03k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
2.03k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
2.03k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
2.03k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
2.03k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
2.03k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
2.03k
  obj_textsec (abfd)->reloc_count =
97
2.03k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
2.03k
  obj_datasec (abfd)->reloc_count =
99
2.03k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
2.03k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
2.03k
  arch_align = 1 << arch_align_power;
109
2.03k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
2.03k
       == obj_textsec (abfd)->size)
111
1.10k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
1.10k
    == obj_datasec (abfd)->size)
113
664
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
664
    == obj_bsssec (abfd)->size))
115
257
    {
116
257
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
257
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
257
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
257
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
2.03k
  return _bfd_no_cleanup;
125
2.03k
}
pdp11.c:pdp11_aout_callback
Line
Count
Source
39
2.83k
{
40
2.83k
  struct internal_exec *execp = exec_hdr (abfd);
41
2.83k
  unsigned int arch_align_power;
42
2.83k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
2.83k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
2.83k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
2.83k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
2.83k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
2.83k
  if (aout_backend_info (abfd)->entry_is_text_address
56
2.83k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
1.88k
    {
58
1.88k
      bfd_vma adjust;
59
60
1.88k
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
1.88k
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
1.88k
      obj_textsec (abfd)->vma += adjust;
64
1.88k
      obj_datasec (abfd)->vma += adjust;
65
1.88k
      obj_bsssec (abfd)->vma += adjust;
66
1.88k
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
2.83k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
2.83k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
2.83k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
2.83k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
2.83k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
2.83k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
2.83k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
2.83k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
2.83k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
2.83k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
2.83k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
2.83k
  obj_textsec (abfd)->reloc_count =
97
2.83k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
2.83k
  obj_datasec (abfd)->reloc_count =
99
2.83k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
2.83k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
2.83k
  arch_align = 1 << arch_align_power;
109
2.83k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
2.83k
       == obj_textsec (abfd)->size)
111
1.55k
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
1.55k
    == obj_datasec (abfd)->size)
113
1.25k
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
1.25k
    == obj_bsssec (abfd)->size))
115
692
    {
116
692
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
692
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
692
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
692
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
2.83k
  return _bfd_no_cleanup;
125
2.83k
}
vax1knetbsd.c:vax_aout_1knbsd_callback
Line
Count
Source
39
1.21k
{
40
1.21k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.21k
  unsigned int arch_align_power;
42
1.21k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.21k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.21k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.21k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.21k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
1.21k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.21k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
978
    {
58
978
      bfd_vma adjust;
59
60
978
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
978
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
978
      obj_textsec (abfd)->vma += adjust;
64
978
      obj_datasec (abfd)->vma += adjust;
65
978
      obj_bsssec (abfd)->vma += adjust;
66
978
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.21k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.21k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.21k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.21k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.21k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.21k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.21k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.21k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.21k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
1.21k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.21k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
1.21k
  obj_textsec (abfd)->reloc_count =
97
1.21k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.21k
  obj_datasec (abfd)->reloc_count =
99
1.21k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
1.21k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.21k
  arch_align = 1 << arch_align_power;
109
1.21k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.21k
       == obj_textsec (abfd)->size)
111
796
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
796
    == obj_datasec (abfd)->size)
113
464
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
464
    == obj_bsssec (abfd)->size))
115
178
    {
116
178
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
178
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
178
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
178
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
1.21k
  return _bfd_no_cleanup;
125
1.21k
}
vaxnetbsd.c:vax_aout_nbsd_callback
Line
Count
Source
39
1.03k
{
40
1.03k
  struct internal_exec *execp = exec_hdr (abfd);
41
1.03k
  unsigned int arch_align_power;
42
1.03k
  unsigned long arch_align;
43
44
  /* Calculate the file positions of the parts of a newly read aout header.  */
45
1.03k
  obj_textsec (abfd)->size = N_TXTSIZE (execp);
46
47
  /* The virtual memory addresses of the sections.  */
48
1.03k
  obj_textsec (abfd)->vma = N_TXTADDR (execp);
49
1.03k
  obj_datasec (abfd)->vma = N_DATADDR (execp);
50
1.03k
  obj_bsssec  (abfd)->vma = N_BSSADDR (execp);
51
52
  /* For some targets, if the entry point is not in the same page
53
     as the start of the text, then adjust the VMA so that it is.
54
     FIXME: Do this with a macro like SET_ARCH_MACH instead?  */
55
1.03k
  if (aout_backend_info (abfd)->entry_is_text_address
56
1.03k
      && execp->a_entry > obj_textsec (abfd)->vma)
57
798
    {
58
798
      bfd_vma adjust;
59
60
798
      adjust = execp->a_entry - obj_textsec (abfd)->vma;
61
      /* Adjust only by whole pages.  */
62
798
      adjust &= ~(TARGET_PAGE_SIZE - 1);
63
798
      obj_textsec (abfd)->vma += adjust;
64
798
      obj_datasec (abfd)->vma += adjust;
65
798
      obj_bsssec (abfd)->vma += adjust;
66
798
    }
67
68
  /* Set the load addresses to be the same as the virtual addresses.  */
69
1.03k
  obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
70
1.03k
  obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
71
1.03k
  obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
72
73
  /* The file offsets of the sections.  */
74
1.03k
  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
75
1.03k
  obj_datasec (abfd)->filepos = N_DATOFF (execp);
76
77
  /* The file offsets of the relocation info.  */
78
1.03k
  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
79
1.03k
  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
80
81
  /* The file offsets of the string table and symbol table.  */
82
1.03k
  obj_sym_filepos (abfd) = N_SYMOFF (execp);
83
1.03k
  obj_str_filepos (abfd) = N_STROFF (execp);
84
85
  /* Determine the architecture and machine type of the object file.  */
86
#ifdef SET_ARCH_MACH
87
  SET_ARCH_MACH (abfd, execp);
88
#else
89
1.03k
  bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0);
90
1.03k
#endif
91
92
  /* The number of relocation records.  This must be called after
93
     SET_ARCH_MACH.  It assumes that SET_ARCH_MACH will set
94
     obj_reloc_entry_size correctly, if the reloc size is not
95
     RELOC_STD_SIZE.  */
96
1.03k
  obj_textsec (abfd)->reloc_count =
97
1.03k
    execp->a_trsize / obj_reloc_entry_size (abfd);
98
1.03k
  obj_datasec (abfd)->reloc_count =
99
1.03k
    execp->a_drsize / obj_reloc_entry_size (abfd);
100
101
  /* Now that we know the architecture, set the alignments of the
102
     sections.  This is normally done by NAME (aout,new_section_hook),
103
     but when the initial sections were created the architecture had
104
     not yet been set.  However, for backward compatibility, we don't
105
     set the alignment power any higher than as required by the size
106
     of the section.  */
107
1.03k
  arch_align_power = bfd_get_arch_info (abfd)->section_align_power;
108
1.03k
  arch_align = 1 << arch_align_power;
109
1.03k
  if ((BFD_ALIGN (obj_textsec (abfd)->size, arch_align)
110
1.03k
       == obj_textsec (abfd)->size)
111
745
      && (BFD_ALIGN (obj_datasec (abfd)->size, arch_align)
112
745
    == obj_datasec (abfd)->size)
113
418
      && (BFD_ALIGN (obj_bsssec (abfd)->size, arch_align)
114
418
    == obj_bsssec (abfd)->size))
115
139
    {
116
139
      obj_textsec (abfd)->alignment_power = arch_align_power;
117
139
      obj_datasec (abfd)->alignment_power = arch_align_power;
118
139
      obj_bsssec (abfd)->alignment_power = arch_align_power;
119
139
    }
120
121
  /* Don't set sizes now -- can't be sure until we know arch & mach.
122
     Sizes get set in set_sizes callback, later.  */
123
124
1.03k
  return _bfd_no_cleanup;
125
1.03k
}
126
#endif
127
128
#ifndef MY_object_p
129
/* Finish up the reading of an a.out file header.  */
130
131
static bfd_cleanup
132
MY (object_p) (bfd *abfd)
133
1.56M
{
134
1.56M
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
1.56M
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
1.56M
  bfd_cleanup cleanup;
137
1.56M
  size_t amt = EXEC_BYTES_SIZE;
138
139
1.56M
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
103k
    {
141
103k
      if (bfd_get_error () != bfd_error_system_call)
142
103k
  bfd_set_error (bfd_error_wrong_format);
143
103k
      return 0;
144
103k
    }
145
146
#ifdef SWAP_MAGIC
147
651k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
807k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
#endif
151
152
1.45M
  if (N_BADMAG (&exec))
153
1.43M
    return 0;
154
155
#ifdef MACHTYPE_OK
156
13.7k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
8.31k
    return 0;
158
5.45k
#endif
159
160
14.3k
  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
6.49k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
#endif
166
167
14.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
1.06k
  if (exec.a_trsize + exec.a_drsize == 0
177
172
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
15
    {
179
15
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
15
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
15
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
15
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
14.3k
  return cleanup;
190
13.7k
}
aout-cris.c:cris_aout_object_p
Line
Count
Source
133
173k
{
134
173k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
173k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
173k
  bfd_cleanup cleanup;
137
173k
  size_t amt = EXEC_BYTES_SIZE;
138
139
173k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.3k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
161k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
161k
#endif
151
152
161k
  if (N_BADMAG (&exec))
153
159k
    return 0;
154
155
2.03k
#ifdef MACHTYPE_OK
156
2.03k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
965
    return 0;
158
1.06k
#endif
159
160
1.06k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
#endif
166
167
1.06k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
1.06k
#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
1.06k
  if (exec.a_trsize + exec.a_drsize == 0
177
172
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
15
    {
179
15
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
15
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
15
    && (buf.st_mode & S_IXUSR) != 0)
185
0
  abfd->flags |= EXEC_P;
186
15
    }
187
1.06k
#endif /* ENTRY_CAN_BE_ZERO */
188
189
1.06k
  return cleanup;
190
2.03k
}
i386aout.c:i386_aout_object_p
Line
Count
Source
133
173k
{
134
173k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
173k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
173k
  bfd_cleanup cleanup;
137
173k
  size_t amt = EXEC_BYTES_SIZE;
138
139
173k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.3k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
161k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
161k
#endif
151
152
161k
  if (N_BADMAG (&exec))
153
159k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
2.03k
  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
2.03k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
2.03k
  return cleanup;
190
161k
}
i386bsd.c:i386_aout_bsd_object_p
Line
Count
Source
133
173k
{
134
173k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
173k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
173k
  bfd_cleanup cleanup;
137
173k
  size_t amt = EXEC_BYTES_SIZE;
138
139
173k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.3k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
161k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
161k
#endif
151
152
161k
  if (N_BADMAG (&exec))
153
159k
    return 0;
154
155
2.03k
#ifdef MACHTYPE_OK
156
2.03k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.29k
    return 0;
158
733
#endif
159
160
733
  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
733
  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
733
  return cleanup;
190
2.03k
}
i386lynx.c:i386_aout_lynx_object_p
Line
Count
Source
133
173k
{
134
173k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
173k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
173k
  bfd_cleanup cleanup;
137
173k
  size_t amt = EXEC_BYTES_SIZE;
138
139
173k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.3k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
161k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
161k
#endif
151
152
161k
  if (N_BADMAG (&exec))
153
159k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
2.03k
  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
2.03k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
2.03k
  return cleanup;
190
161k
}
ns32knetbsd.c:ns32k_aout_pc532nbsd_object_p
Line
Count
Source
133
174k
{
134
174k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
174k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
174k
  bfd_cleanup cleanup;
137
174k
  size_t amt = EXEC_BYTES_SIZE;
138
139
174k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.4k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
161k
#ifdef SWAP_MAGIC
147
161k
  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
161k
  if (N_BADMAG (&exec))
153
158k
    return 0;
154
155
3.25k
#ifdef MACHTYPE_OK
156
3.25k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
1.84k
    return 0;
158
1.41k
#endif
159
160
1.41k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.41k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.41k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.41k
#endif
166
167
1.41k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
1.41k
  return cleanup;
190
3.25k
}
pc532-mach.c:ns32k_aout_pc532mach_object_p
Line
Count
Source
133
173k
{
134
173k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
173k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
173k
  bfd_cleanup cleanup;
137
173k
  size_t amt = EXEC_BYTES_SIZE;
138
139
173k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.4k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
#ifdef SWAP_MAGIC
147
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
148
#else
149
161k
  exec.a_info = GET_MAGIC (abfd, exec_bytes.e_info);
150
161k
#endif
151
152
161k
  if (N_BADMAG (&exec))
153
159k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
2.03k
  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
2.03k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
2.03k
  return cleanup;
190
161k
}
pdp11.c:pdp11_aout_object_p
Line
Count
Source
133
171k
{
134
171k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
171k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
171k
  bfd_cleanup cleanup;
137
171k
  size_t amt = EXEC_BYTES_SIZE;
138
139
171k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
4.15k
    {
141
4.15k
      if (bfd_get_error () != bfd_error_system_call)
142
4.12k
  bfd_set_error (bfd_error_wrong_format);
143
4.15k
      return 0;
144
4.15k
    }
145
146
167k
#ifdef SWAP_MAGIC
147
167k
  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
167k
  if (N_BADMAG (&exec))
153
164k
    return 0;
154
155
#ifdef MACHTYPE_OK
156
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
    return 0;
158
#endif
159
160
2.83k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
2.83k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
2.83k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
2.83k
#endif
166
167
2.83k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
2.83k
  return cleanup;
190
167k
}
vax1knetbsd.c:vax_aout_1knbsd_object_p
Line
Count
Source
133
174k
{
134
174k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
174k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
174k
  bfd_cleanup cleanup;
137
174k
  size_t amt = EXEC_BYTES_SIZE;
138
139
174k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.4k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
161k
#ifdef SWAP_MAGIC
147
161k
  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
161k
  if (N_BADMAG (&exec))
153
158k
    return 0;
154
155
3.23k
#ifdef MACHTYPE_OK
156
3.23k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
2.02k
    return 0;
158
1.21k
#endif
159
160
1.21k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.21k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.21k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.21k
#endif
166
167
1.21k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
1.21k
  return cleanup;
190
3.23k
}
vaxnetbsd.c:vax_aout_nbsd_object_p
Line
Count
Source
133
174k
{
134
174k
  struct external_exec exec_bytes;  /* Raw exec header from file.  */
135
174k
  struct internal_exec exec;    /* Cleaned-up exec header.  */
136
174k
  bfd_cleanup cleanup;
137
174k
  size_t amt = EXEC_BYTES_SIZE;
138
139
174k
  if (bfd_read (&exec_bytes, amt, abfd) != amt)
140
12.4k
    {
141
12.4k
      if (bfd_get_error () != bfd_error_system_call)
142
12.4k
  bfd_set_error (bfd_error_wrong_format);
143
12.4k
      return 0;
144
12.4k
    }
145
146
161k
#ifdef SWAP_MAGIC
147
161k
  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
161k
  if (N_BADMAG (&exec))
153
158k
    return 0;
154
155
3.22k
#ifdef MACHTYPE_OK
156
3.22k
  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
157
2.19k
    return 0;
158
1.03k
#endif
159
160
1.03k
  NAME (aout, swap_exec_header_in) (abfd, &exec_bytes, &exec);
161
162
1.03k
#ifdef SWAP_MAGIC
163
  /* Swap_exec_header_in read in a_info with the wrong byte order.  */
164
1.03k
  exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
165
1.03k
#endif
166
167
1.03k
  cleanup = NAME (aout, some_aout_object_p) (abfd, &exec, MY (callback));
168
169
#ifdef ENTRY_CAN_BE_ZERO
170
  /* The NEWSOS3 entry-point is/was 0, which (amongst other lossage)
171
     means that it isn't obvious if EXEC_P should be set.
172
     All of the following must be true for an executable:
173
     There must be no relocations, the bfd can be neither an
174
     archive nor an archive element, and the file must be executable.  */
175
176
  if (exec.a_trsize + exec.a_drsize == 0
177
      && bfd_get_format(abfd) == bfd_object && abfd->my_archive == NULL)
178
    {
179
      struct stat buf;
180
#ifndef S_IXUSR
181
#define S_IXUSR 0100  /* Execute by owner.  */
182
#endif
183
      if (stat (bfd_get_filename (abfd), &buf) == 0
184
    && (buf.st_mode & S_IXUSR) != 0)
185
  abfd->flags |= EXEC_P;
186
    }
187
#endif /* ENTRY_CAN_BE_ZERO */
188
189
1.03k
  return cleanup;
190
3.22k
}
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
727
{
199
727
  return NAME (aout, mkobject (abfd));
200
727
}
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
179
{
199
179
  return NAME (aout, mkobject (abfd));
200
179
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_mkobject
pdp11.c:pdp11_aout_mkobject
Line
Count
Source
198
359
{
199
359
  return NAME (aout, mkobject (abfd));
200
359
}
vax1knetbsd.c:vax_aout_1knbsd_mkobject
Line
Count
Source
198
64
{
199
64
  return NAME (aout, mkobject (abfd));
200
64
}
vaxnetbsd.c:vax_aout_nbsd_mkobject
Line
Count
Source
198
125
{
199
125
  return NAME (aout, mkobject (abfd));
200
125
}
201
202
#define MY_mkobject MY (mkobject)
203
#endif
204
205
#ifndef MY_bfd_copy_private_section_data
206
207
/* Copy private section data.  This actually does nothing with the
208
   sections.  It copies the subformat field.  We copy it here, because
209
   we need to know whether this is a QMAGIC file before we set the
210
   section contents, and copy_private_bfd_data is not called until
211
   after the section contents have been set.  */
212
213
static bool
214
MY_bfd_copy_private_section_data (bfd *ibfd,
215
          asection *isec ATTRIBUTE_UNUSED,
216
          bfd *obfd,
217
          asection *osec ATTRIBUTE_UNUSED,
218
          struct bfd_link_info *link_info)
219
579
{
220
579
  if (link_info == NULL
221
579
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
579
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
579
  return true;
224
579
}
Unexecuted instantiation: aout-cris.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386aout.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386bsd.c:MY_bfd_copy_private_section_data
Unexecuted instantiation: i386lynx.c:MY_bfd_copy_private_section_data
ns32knetbsd.c:MY_bfd_copy_private_section_data
Line
Count
Source
219
111
{
220
111
  if (link_info == NULL
221
111
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
111
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
111
}
Unexecuted instantiation: pc532-mach.c:MY_bfd_copy_private_section_data
pdp11.c:MY_bfd_copy_private_section_data
Line
Count
Source
219
336
{
220
336
  if (link_info == NULL
221
336
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
336
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
336
}
vax1knetbsd.c:MY_bfd_copy_private_section_data
Line
Count
Source
219
54
{
220
54
  if (link_info == NULL
221
54
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
54
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
54
}
vaxnetbsd.c:MY_bfd_copy_private_section_data
Line
Count
Source
219
78
{
220
78
  if (link_info == NULL
221
78
      && bfd_get_flavour (ibfd) == bfd_target_aout_flavour)
222
78
    obj_aout_subformat (obfd) = obj_aout_subformat (ibfd);
223
  return true;
224
78
}
225
226
#endif
227
228
/* Write an object file.
229
   Section contents have already been written.  We write the
230
   file header, symbols, and relocation.  */
231
232
#ifndef MY_write_object_contents
233
234
static bool
235
MY (write_object_contents) (bfd *abfd)
236
0
{
237
0
  struct external_exec exec_bytes;
238
0
  struct internal_exec *execp = exec_hdr (abfd);
239
240
0
  obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
241
242
0
  WRITE_HEADERS (abfd, execp);
243
244
0
  return true;
245
0
}
Unexecuted instantiation: i386bsd.c:i386_aout_bsd_write_object_contents
Unexecuted instantiation: i386lynx.c:i386_aout_lynx_write_object_contents
246
#define MY_write_object_contents MY (write_object_contents)
247
#endif
248
249
#ifndef MY_set_sizes
250
251
static bool
252
MY (set_sizes) (bfd *abfd)
253
727
{
254
727
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
727
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
727
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
727
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
259
#else
260
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
261
#endif
262
263
727
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
727
  return true;
265
727
}
Unexecuted instantiation: i386aout.c:i386_aout_set_sizes
Unexecuted instantiation: i386bsd.c:i386_aout_bsd_set_sizes
Unexecuted instantiation: i386lynx.c:i386_aout_lynx_set_sizes
ns32knetbsd.c:ns32k_aout_pc532nbsd_set_sizes
Line
Count
Source
253
179
{
254
179
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
179
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
179
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
179
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
259
#else
260
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
261
#endif
262
263
179
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
179
}
Unexecuted instantiation: pc532-mach.c:ns32k_aout_pc532mach_set_sizes
pdp11.c:pdp11_aout_set_sizes
Line
Count
Source
253
359
{
254
359
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
359
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
359
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
359
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
259
#else
260
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
261
#endif
262
263
359
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
359
}
vax1knetbsd.c:vax_aout_1knbsd_set_sizes
Line
Count
Source
253
64
{
254
64
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
64
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
64
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
64
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
259
#else
260
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
261
#endif
262
263
64
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
64
}
vaxnetbsd.c:vax_aout_nbsd_set_sizes
Line
Count
Source
253
125
{
254
125
  adata(abfd).page_size = TARGET_PAGE_SIZE;
255
125
  adata(abfd).segment_size = SEGMENT_SIZE;
256
257
125
#ifdef ZMAGIC_DISK_BLOCK_SIZE
258
125
  adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE;
259
#else
260
  adata(abfd).zmagic_disk_block_size = TARGET_PAGE_SIZE;
261
#endif
262
263
125
  adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE;
264
  return true;
265
125
}
266
#define MY_set_sizes MY (set_sizes)
267
#endif
268
269
#ifndef MY_exec_hdr_flags
270
#define MY_exec_hdr_flags 0
271
#endif
272
273
#ifndef MY_backend_data
274
275
#ifndef MY_zmagic_contiguous
276
#define MY_zmagic_contiguous 0
277
#endif
278
#ifndef MY_text_includes_header
279
#define MY_text_includes_header 0
280
#endif
281
#ifndef MY_entry_is_text_address
282
#define MY_entry_is_text_address 0
283
#endif
284
#ifndef MY_exec_header_not_counted
285
#define MY_exec_header_not_counted 0
286
#endif
287
#ifndef MY_add_dynamic_symbols
288
#define MY_add_dynamic_symbols 0
289
#endif
290
#ifndef MY_link_dynamic_object
291
#define MY_link_dynamic_object 0
292
#endif
293
#ifndef MY_write_dynamic_symbol
294
#define MY_write_dynamic_symbol 0
295
#endif
296
#ifndef MY_check_dynamic_reloc
297
#define MY_check_dynamic_reloc 0
298
#endif
299
#ifndef MY_finish_dynamic_link
300
#define MY_finish_dynamic_link 0
301
#endif
302
303
static const struct aout_backend_data MY (backend_data) =
304
{
305
  MY_zmagic_contiguous,
306
  MY_text_includes_header,
307
  MY_entry_is_text_address,
308
  MY_exec_hdr_flags,
309
  0,        /* Text vma?  */
310
  MY_set_sizes,
311
  MY_exec_header_not_counted,
312
  MY_add_dynamic_symbols,
313
  MY_link_dynamic_object,
314
  MY_write_dynamic_symbol,
315
  MY_check_dynamic_reloc,
316
  MY_finish_dynamic_link
317
};
318
#define MY_backend_data &MY (backend_data)
319
#endif
320
321
#ifndef MY_final_link_callback
322
323
/* Callback for the final_link routine to set the section offsets.  */
324
325
static void
326
MY_final_link_callback (bfd *abfd,
327
      file_ptr *ptreloff,
328
      file_ptr *pdreloff,
329
      file_ptr *psymoff)
330
0
{
331
0
  struct internal_exec *execp = exec_hdr (abfd);
332
333
0
  *ptreloff = N_TRELOFF (execp);
334
0
  *pdreloff = N_DRELOFF (execp);
335
0
  *psymoff = N_SYMOFF (execp);
336
0
}
Unexecuted instantiation: aout-cris.c:MY_final_link_callback
Unexecuted instantiation: i386aout.c:MY_final_link_callback
Unexecuted instantiation: i386bsd.c:MY_final_link_callback
Unexecuted instantiation: i386lynx.c:MY_final_link_callback
Unexecuted instantiation: ns32knetbsd.c:MY_final_link_callback
Unexecuted instantiation: pc532-mach.c:MY_final_link_callback
Unexecuted instantiation: pdp11.c:MY_final_link_callback
Unexecuted instantiation: vax1knetbsd.c:MY_final_link_callback
Unexecuted instantiation: vaxnetbsd.c:MY_final_link_callback
337
338
#endif
339
340
#ifndef MY_bfd_final_link
341
342
/* Final link routine.  We need to use a call back to get the correct
343
   offsets in the output file.  */
344
345
static bool
346
MY_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
347
0
{
348
0
  return NAME (aout, final_link) (abfd, info, MY_final_link_callback);
349
0
}
Unexecuted instantiation: aout-cris.c:MY_bfd_final_link
Unexecuted instantiation: i386aout.c:MY_bfd_final_link
Unexecuted instantiation: i386bsd.c:MY_bfd_final_link
Unexecuted instantiation: i386lynx.c:MY_bfd_final_link
Unexecuted instantiation: ns32knetbsd.c:MY_bfd_final_link
Unexecuted instantiation: pc532-mach.c:MY_bfd_final_link
Unexecuted instantiation: pdp11.c:MY_bfd_final_link
Unexecuted instantiation: vax1knetbsd.c:MY_bfd_final_link
Unexecuted instantiation: vaxnetbsd.c:MY_bfd_final_link
350
351
#endif
352
353
/* We assume BFD generic archive files.  */
354
#ifndef MY_openr_next_archived_file
355
#define MY_openr_next_archived_file bfd_generic_openr_next_archived_file
356
#endif
357
#ifndef MY_get_elt_at_index
358
#define MY_get_elt_at_index   _bfd_generic_get_elt_at_index
359
#endif
360
#ifndef MY_generic_stat_arch_elt
361
#define MY_generic_stat_arch_elt  bfd_generic_stat_arch_elt
362
#endif
363
#ifndef MY_slurp_armap
364
#define MY_slurp_armap      bfd_slurp_bsd_armap
365
#endif
366
#ifndef MY_slurp_extended_name_table
367
#define MY_slurp_extended_name_table  _bfd_slurp_extended_name_table
368
#endif
369
#ifndef MY_construct_extended_name_table
370
#define MY_construct_extended_name_table \
371
  _bfd_archive_bsd_construct_extended_name_table
372
#endif
373
#ifndef MY_write_armap
374
#define MY_write_armap    _bfd_bsd_write_armap
375
#endif
376
#ifndef MY_read_ar_hdr
377
#define MY_read_ar_hdr    _bfd_generic_read_ar_hdr
378
#endif
379
#ifndef MY_write_ar_hdr
380
#define MY_write_ar_hdr   _bfd_generic_write_ar_hdr
381
#endif
382
#ifndef MY_truncate_arname
383
#define MY_truncate_arname    bfd_bsd_truncate_arname
384
#endif
385
#ifndef MY_update_armap_timestamp
386
#define MY_update_armap_timestamp _bfd_archive_bsd_update_armap_timestamp
387
#endif
388
389
/* No core file defined here -- configure in trad-core.c separately.  */
390
#ifndef MY_core_file_failing_command
391
#define MY_core_file_failing_command _bfd_nocore_core_file_failing_command
392
#endif
393
#ifndef MY_core_file_failing_signal
394
#define MY_core_file_failing_signal _bfd_nocore_core_file_failing_signal
395
#endif
396
#ifndef MY_core_file_matches_executable_p
397
#define MY_core_file_matches_executable_p \
398
        _bfd_nocore_core_file_matches_executable_p
399
#endif
400
#ifndef MY_core_file_pid
401
#define MY_core_file_pid _bfd_nocore_core_file_pid
402
#endif
403
#ifndef MY_core_file_p
404
#define MY_core_file_p    _bfd_dummy_target
405
#endif
406
407
#ifndef MY_bfd_debug_info_start
408
#define MY_bfd_debug_info_start   _bfd_void_bfd
409
#endif
410
#ifndef MY_bfd_debug_info_end
411
#define MY_bfd_debug_info_end   _bfd_void_bfd
412
#endif
413
#ifndef MY_bfd_debug_info_accumulate
414
#define MY_bfd_debug_info_accumulate  _bfd_void_bfd_asection
415
#endif
416
417
#ifndef MY_core_file_failing_command
418
#define MY_core_file_failing_command NAME (aout, core_file_failing_command)
419
#endif
420
#ifndef MY_core_file_failing_signal
421
#define MY_core_file_failing_signal NAME (aout, core_file_failing_signal)
422
#endif
423
#ifndef MY_core_file_matches_executable_p
424
#define MY_core_file_matches_executable_p NAME (aout, core_file_matches_executable_p)
425
#endif
426
#ifndef MY_set_section_contents
427
#define MY_set_section_contents NAME (aout, set_section_contents)
428
#endif
429
#ifndef MY_get_section_contents
430
#define MY_get_section_contents NAME (aout, get_section_contents)
431
#endif
432
#ifndef MY_new_section_hook
433
#define MY_new_section_hook NAME (aout, new_section_hook)
434
#endif
435
#ifndef MY_get_symtab_upper_bound
436
#define MY_get_symtab_upper_bound NAME (aout, get_symtab_upper_bound)
437
#endif
438
#ifndef MY_canonicalize_symtab
439
#define MY_canonicalize_symtab NAME (aout, canonicalize_symtab)
440
#endif
441
#ifndef MY_get_reloc_upper_bound
442
#define MY_get_reloc_upper_bound NAME (aout,get_reloc_upper_bound)
443
#endif
444
#ifndef MY_canonicalize_reloc
445
#define MY_canonicalize_reloc NAME (aout, canonicalize_reloc)
446
#endif
447
#ifndef MY_finalize_section_relocs
448
#define MY_finalize_section_relocs _bfd_generic_finalize_section_relocs
449
#endif
450
#ifndef MY_make_empty_symbol
451
#define MY_make_empty_symbol NAME (aout, make_empty_symbol)
452
#endif
453
#ifndef MY_print_symbol
454
#define MY_print_symbol NAME (aout, print_symbol)
455
#endif
456
#ifndef MY_get_symbol_info
457
#define MY_get_symbol_info NAME (aout, get_symbol_info)
458
#endif
459
#ifndef MY_get_symbol_version_string
460
#define MY_get_symbol_version_string \
461
  _bfd_nosymbols_get_symbol_version_string
462
#endif
463
#ifndef MY_get_lineno
464
#define MY_get_lineno NAME (aout, get_lineno)
465
#endif
466
#ifndef MY_set_arch_mach
467
#define MY_set_arch_mach NAME (aout, set_arch_mach)
468
#endif
469
#ifndef MY_find_nearest_line
470
#define MY_find_nearest_line NAME (aout, find_nearest_line)
471
#endif
472
#ifndef MY_find_nearest_line_with_alt
473
#define MY_find_nearest_line_with_alt _bfd_nosymbols_find_nearest_line_with_alt
474
#endif
475
#ifndef MY_find_line
476
#define MY_find_line _bfd_nosymbols_find_line
477
#endif
478
#ifndef MY_find_inliner_info
479
#define MY_find_inliner_info _bfd_nosymbols_find_inliner_info
480
#endif
481
#ifndef MY_sizeof_headers
482
#define MY_sizeof_headers NAME (aout, sizeof_headers)
483
#endif
484
#ifndef MY_bfd_get_relocated_section_contents
485
#define MY_bfd_get_relocated_section_contents \
486
      bfd_generic_get_relocated_section_contents
487
#endif
488
#ifndef MY_bfd_relax_section
489
#define MY_bfd_relax_section bfd_generic_relax_section
490
#endif
491
#ifndef MY_bfd_gc_sections
492
#define MY_bfd_gc_sections bfd_generic_gc_sections
493
#endif
494
#ifndef MY_bfd_lookup_section_flags
495
#define MY_bfd_lookup_section_flags bfd_generic_lookup_section_flags
496
#endif
497
#ifndef MY_bfd_is_group_section
498
#define MY_bfd_is_group_section bfd_generic_is_group_section
499
#endif
500
#ifndef MY_bfd_group_name
501
#define MY_bfd_group_name bfd_generic_group_name
502
#endif
503
#ifndef MY_bfd_discard_group
504
#define MY_bfd_discard_group bfd_generic_discard_group
505
#endif
506
#ifndef MY_section_already_linked
507
#define MY_section_already_linked \
508
  _bfd_generic_section_already_linked
509
#endif
510
#ifndef MY_bfd_define_common_symbol
511
#define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
512
#endif
513
#ifndef MY_bfd_link_hide_symbol
514
#define MY_bfd_link_hide_symbol _bfd_generic_link_hide_symbol
515
#endif
516
#ifndef MY_bfd_define_start_stop
517
#define MY_bfd_define_start_stop bfd_generic_define_start_stop
518
#endif
519
#ifndef MY_bfd_reloc_type_lookup
520
#define MY_bfd_reloc_type_lookup NAME (aout, reloc_type_lookup)
521
#endif
522
#ifndef MY_bfd_reloc_name_lookup
523
#define MY_bfd_reloc_name_lookup NAME (aout, reloc_name_lookup)
524
#endif
525
#ifndef MY_bfd_make_debug_symbol
526
#define MY_bfd_make_debug_symbol 0
527
#endif
528
#ifndef MY_read_minisymbols
529
#define MY_read_minisymbols NAME (aout, read_minisymbols)
530
#endif
531
#ifndef MY_minisymbol_to_symbol
532
#define MY_minisymbol_to_symbol NAME (aout, minisymbol_to_symbol)
533
#endif
534
#ifndef MY_bfd_link_hash_table_create
535
#define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
536
#endif
537
#ifndef MY_bfd_link_add_symbols
538
#define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
539
#endif
540
#ifndef MY_bfd_link_just_syms
541
#define MY_bfd_link_just_syms _bfd_generic_link_just_syms
542
#endif
543
#ifndef MY_bfd_copy_link_hash_symbol_type
544
#define MY_bfd_copy_link_hash_symbol_type \
545
  _bfd_generic_copy_link_hash_symbol_type
546
#endif
547
#ifndef MY_bfd_link_split_section
548
#define MY_bfd_link_split_section  _bfd_generic_link_split_section
549
#endif
550
551
#ifndef MY_bfd_link_check_relocs
552
#define MY_bfd_link_check_relocs   _bfd_generic_link_check_relocs
553
#endif
554
555
#ifndef MY_bfd_copy_private_bfd_data
556
#define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
557
#endif
558
559
#ifndef MY_bfd_merge_private_bfd_data
560
#define MY_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data
561
#endif
562
563
#ifndef MY_bfd_copy_private_symbol_data
564
#define MY_bfd_copy_private_symbol_data _bfd_generic_bfd_copy_private_symbol_data
565
#endif
566
567
#ifndef MY_bfd_copy_private_header_data
568
#define MY_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data
569
#endif
570
571
#ifndef MY_bfd_print_private_bfd_data
572
#define MY_bfd_print_private_bfd_data _bfd_generic_bfd_print_private_bfd_data
573
#endif
574
575
#ifndef MY_bfd_set_private_flags
576
#define MY_bfd_set_private_flags _bfd_generic_bfd_set_private_flags
577
#endif
578
579
#ifndef MY_bfd_is_local_label_name
580
#define MY_bfd_is_local_label_name bfd_generic_is_local_label_name
581
#endif
582
583
#ifndef MY_bfd_is_target_special_symbol
584
#define MY_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false
585
#endif
586
587
#ifndef MY_bfd_free_cached_info
588
#define MY_bfd_free_cached_info NAME (aout, bfd_free_cached_info)
589
#endif
590
591
#ifndef MY_close_and_cleanup
592
#define MY_close_and_cleanup _bfd_generic_close_and_cleanup
593
#endif
594
595
#ifndef MY_get_dynamic_symtab_upper_bound
596
#define MY_get_dynamic_symtab_upper_bound \
597
  _bfd_nodynamic_get_dynamic_symtab_upper_bound
598
#endif
599
#ifndef MY_canonicalize_dynamic_symtab
600
#define MY_canonicalize_dynamic_symtab \
601
  _bfd_nodynamic_canonicalize_dynamic_symtab
602
#endif
603
#ifndef MY_get_synthetic_symtab
604
#define MY_get_synthetic_symtab \
605
  _bfd_nodynamic_get_synthetic_symtab
606
#endif
607
#ifndef MY_get_dynamic_reloc_upper_bound
608
#define MY_get_dynamic_reloc_upper_bound \
609
  _bfd_nodynamic_get_dynamic_reloc_upper_bound
610
#endif
611
#ifndef MY_canonicalize_dynamic_reloc
612
#define MY_canonicalize_dynamic_reloc \
613
  _bfd_nodynamic_canonicalize_dynamic_reloc
614
#endif
615
616
/* Aout symbols normally have leading underscores.  */
617
#ifndef MY_symbol_leading_char
618
#define MY_symbol_leading_char '_'
619
#endif
620
621
/* Aout archives normally use spaces for padding.  */
622
#ifndef AR_PAD_CHAR
623
#define AR_PAD_CHAR ' '
624
#endif
625
626
#ifndef MY_BFD_TARGET
627
const bfd_target MY (vec) =
628
{
629
  TARGETNAME,     /* Name.  */
630
  bfd_target_aout_flavour,
631
#ifdef TARGET_IS_BIG_ENDIAN_P
632
  BFD_ENDIAN_BIG,   /* Target byte order (big).  */
633
  BFD_ENDIAN_BIG,   /* Target headers byte order (big).  */
634
#else
635
  BFD_ENDIAN_LITTLE,    /* Target byte order (little).  */
636
  BFD_ENDIAN_LITTLE,    /* Target headers byte order (little).  */
637
#endif
638
  (HAS_RELOC | EXEC_P |   /* Object flags.  */
639
   HAS_LINENO | HAS_DEBUG |
640
   HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED),
641
  (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA),
642
  MY_symbol_leading_char,
643
  AR_PAD_CHAR,      /* AR_pad_char.  */
644
  15,       /* AR_max_namelen.  */
645
  0,        /* match priority.  */
646
  TARGET_KEEP_UNUSED_SECTION_SYMBOLS, /* keep unused section symbols.  */
647
  TARGET_MERGE_SECTIONS,
648
#ifdef TARGET_IS_BIG_ENDIAN_P
649
  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
650
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
651
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Data.  */
652
  bfd_getb64, bfd_getb_signed_64, bfd_putb64,
653
     bfd_getb32, bfd_getb_signed_32, bfd_putb32,
654
     bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* Headers.  */
655
#else
656
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
657
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
658
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Data.  */
659
  bfd_getl64, bfd_getl_signed_64, bfd_putl64,
660
     bfd_getl32, bfd_getl_signed_32, bfd_putl32,
661
     bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* Headers.  */
662
#endif
663
    {       /* bfd_check_format.  */
664
      _bfd_dummy_target,
665
      MY_object_p,
666
      bfd_generic_archive_p,
667
      MY_core_file_p
668
    },
669
    {       /* bfd_set_format.  */
670
      _bfd_bool_bfd_false_error,
671
      MY_mkobject,
672
      _bfd_generic_mkarchive,
673
      _bfd_bool_bfd_false_error
674
    },
675
    {       /* bfd_write_contents.  */
676
      _bfd_bool_bfd_false_error,
677
      MY_write_object_contents,
678
      _bfd_write_archive_contents,
679
      _bfd_bool_bfd_false_error
680
    },
681
682
     BFD_JUMP_TABLE_GENERIC (MY),
683
     BFD_JUMP_TABLE_COPY (MY),
684
     BFD_JUMP_TABLE_CORE (MY),
685
     BFD_JUMP_TABLE_ARCHIVE (MY),
686
     BFD_JUMP_TABLE_SYMBOLS (MY),
687
     BFD_JUMP_TABLE_RELOCS (MY),
688
     BFD_JUMP_TABLE_WRITE (MY),
689
     BFD_JUMP_TABLE_LINK (MY),
690
     BFD_JUMP_TABLE_DYNAMIC (MY),
691
692
  /* Alternative_target.  */
693
  NULL,
694
695
  MY_backend_data
696
};
697
#endif /* MY_BFD_TARGET */