libaout.h revision 33965
1/* BFD back-end data structures for a.out (and similar) files.
2   Copyright 1990, 91, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
3   Written by Cygnus Support.
4
5This file is part of BFD, the Binary File Descriptor library.
6
7This program is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
20
21#ifndef LIBAOUT_H
22#define LIBAOUT_H
23
24/* We try to encapsulate the differences in the various a.out file
25   variants in a few routines, and otherwise share large masses of code.
26   This means we only have to fix bugs in one place, most of the time.  */
27
28#include "bfdlink.h"
29
30/* Parameterize the a.out code based on whether it is being built
31   for a 32-bit architecture or a 64-bit architecture.  */
32#if ARCH_SIZE==64
33#define GET_WORD bfd_h_get_64
34#define GET_SWORD bfd_h_get_signed_64
35#define PUT_WORD bfd_h_put_64
36#ifndef NAME
37#define NAME(x,y) CAT3(x,_64_,y)
38#endif
39#define JNAME(x) CAT(x,_64)
40#define BYTES_IN_WORD 8
41#else /* ARCH_SIZE == 32 */
42#define GET_WORD bfd_h_get_32
43#define GET_SWORD bfd_h_get_signed_32
44#define PUT_WORD bfd_h_put_32
45#ifndef NAME
46#define NAME(x,y) CAT3(x,_32_,y)
47#endif
48#define JNAME(x) CAT(x,_32)
49#define BYTES_IN_WORD 4
50#endif /* ARCH_SIZE==32 */
51
52/* Declare at file level, since used in parameter lists, which have
53   weird scope.  */
54struct external_exec;
55struct external_nlist;
56struct reloc_ext_external;
57struct reloc_std_external;
58
59/* a.out backend linker hash table entries.  */
60
61struct aout_link_hash_entry
62{
63  struct bfd_link_hash_entry root;
64  /* Whether this symbol has been written out.  */
65  boolean written;
66  /* Symbol index in output file.  */
67  int indx;
68};
69
70/* a.out backend linker hash table.  */
71
72struct aout_link_hash_table
73{
74  struct bfd_link_hash_table root;
75};
76
77/* Look up an entry in an a.out link hash table.  */
78
79#define aout_link_hash_lookup(table, string, create, copy, follow) \
80  ((struct aout_link_hash_entry *) \
81   bfd_link_hash_lookup (&(table)->root, (string), (create), (copy), (follow)))
82
83/* Traverse an a.out link hash table.  */
84
85#define aout_link_hash_traverse(table, func, info)			\
86  (bfd_link_hash_traverse						\
87   (&(table)->root,							\
88    (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func),	\
89    (info)))
90
91/* Get the a.out link hash table from the info structure.  This is
92   just a cast.  */
93
94#define aout_hash_table(p) ((struct aout_link_hash_table *) ((p)->hash))
95
96/* Back-end information for various a.out targets.  */
97struct aout_backend_data
98{
99  /* Are ZMAGIC files mapped contiguously?  If so, the text section may
100     need more padding, if the segment size (granularity for memory access
101     control) is larger than the page size.  */
102  unsigned char zmagic_mapped_contiguous;
103  /* If this flag is set, ZMAGIC/NMAGIC file headers get mapped in with the
104     text section, which starts immediately after the file header.
105     If not, the text section starts on the next page.  */
106  unsigned char text_includes_header;
107
108  /* If this flag is set, then if the entry address is not in the
109     first SEGMENT_SIZE bytes of the text section, it is taken to be
110     the address of the start of the text section.  This can be useful
111     for kernels.  */
112  unsigned char entry_is_text_address;
113
114  /* The value to pass to N_SET_FLAGS.  */
115  unsigned char exec_hdr_flags;
116
117  /* If the text section VMA isn't specified, and we need an absolute
118     address, use this as the default.  If we're producing a relocatable
119     file, zero is always used.  */
120  /* ?? Perhaps a callback would be a better choice?  Will this do anything
121     reasonable for a format that handles multiple CPUs with different
122     load addresses for each?  */
123  bfd_vma default_text_vma;
124
125  /* Callback for setting the page and segment sizes, if they can't be
126     trivially determined from the architecture.  */
127  boolean (*set_sizes) PARAMS ((bfd *));
128
129  /* zmagic files only. For go32, the length of the exec header contributes
130     to the size of the text section in the file for alignment purposes but
131     does *not* get counted in the length of the text section. */
132  unsigned char exec_header_not_counted;
133
134  /* Callback from the add symbols phase of the linker code to handle
135     a dynamic object.  */
136  boolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *,
137					  struct external_nlist **,
138					  bfd_size_type *, char **));
139
140  /* Callback from the add symbols phase of the linker code to handle
141     adding a single symbol to the global linker hash table.  */
142  boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *,
143				     const char *, flagword, asection *,
144				     bfd_vma, const char *, boolean,
145				     boolean,
146				     struct bfd_link_hash_entry **));
147
148  /* Called to handle linking a dynamic object.  */
149  boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *));
150
151  /* Called for each global symbol being written out by the linker.
152     This should write out the dynamic symbol information.  */
153  boolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *,
154					   struct aout_link_hash_entry *));
155
156  /* If this callback is not NULL, the linker calls it for each reloc.
157     RELOC is a pointer to the unswapped reloc.  If *SKIP is set to
158     true, the reloc will be skipped.  *RELOCATION may be changed to
159     change the effects of the relocation.  */
160  boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info,
161					  bfd *input_bfd,
162					  asection *input_section,
163					  struct aout_link_hash_entry *h,
164					  PTR reloc, bfd_byte *contents,
165					  boolean *skip,
166					  bfd_vma *relocation));
167
168  /* Called at the end of a link to finish up any dynamic linking
169     information.  */
170  boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *));
171};
172#define aout_backend_info(abfd) \
173	((CONST struct aout_backend_data *)((abfd)->xvec->backend_data))
174
175/* This is the layout in memory of a "struct exec" while we process it.
176   All 'lengths' are given as a number of bytes.
177   All 'alignments' are for relinkable files only;  an alignment of
178	'n' indicates the corresponding segment must begin at an
179	address that is a multiple of (2**n).  */
180
181struct internal_exec
182{
183    long a_info;		/* Magic number and flags, packed */
184    bfd_vma a_text;		/* length of text, in bytes  */
185    bfd_vma a_data;		/* length of data, in bytes  */
186    bfd_vma a_bss;		/* length of uninitialized data area in mem */
187    bfd_vma a_syms;		/* length of symbol table data in file */
188    bfd_vma a_entry;		/* start address */
189    bfd_vma a_trsize;		/* length of text's relocation info, in bytes */
190    bfd_vma a_drsize;		/* length of data's relocation info, in bytes */
191    /* Added for i960 */
192    bfd_vma a_tload;		/* Text runtime load address */
193    bfd_vma a_dload;		/* Data runtime load address */
194    unsigned char a_talign;	/* Alignment of text segment */
195    unsigned char a_dalign;	/* Alignment of data segment */
196    unsigned char a_balign;	/* Alignment of bss segment */
197    char a_relaxable;           /* Enough info for linker relax */
198};
199
200/* Magic number is written
201< MSB          >
2023130292827262524232221201918171615141312111009080706050403020100
203< FLAGS        >< MACHINE TYPE ><  MAGIC NUMBER                >
204*/
205/* Magic number for NetBSD is
206<MSB           >
2073130292827262524232221201918171615141312111009080706050403020100
208< FLAGS    >< MACHINE TYPE     ><  MAGIC NUMBER                >
209*/
210
211enum machine_type {
212  M_UNKNOWN = 0,
213  M_68010 = 1,
214  M_68020 = 2,
215  M_SPARC = 3,
216  /* skip a bunch so we don't run into any of suns numbers */
217  /* make these up for the ns32k*/
218  M_NS32032 = (64),		/* ns32032 running ? */
219  M_NS32532 = (64 + 5),		/* ns32532 running mach */
220
221  M_386 = 100,
222  M_29K = 101,          /* AMD 29000 */
223  M_386_DYNIX = 102,	/* Sequent running dynix */
224  M_ARM = 103,		/* Advanced Risc Machines ARM */
225  M_SPARCLET = 131,	/* SPARClet = M_SPARC + 128 */
226  M_386_NETBSD = 134,	/* NetBSD/i386 binary */
227  M_68K_NETBSD = 135,	/* NetBSD/m68k binary */
228  M_68K4K_NETBSD = 136,	/* NetBSD/m68k4k binary */
229  M_532_NETBSD = 137,	/* NetBSD/ns32k binary */
230  M_SPARC_NETBSD = 138,	/* NetBSD/sparc binary */
231  M_SPARCLET_1 = 147,	/* 0x93, reserved */
232  M_MIPS1 = 151,        /* MIPS R2000/R3000 binary */
233  M_MIPS2 = 152,        /* MIPS R4000/R6000 binary */
234  M_SPARCLET_2 = 163,	/* 0xa3, reserved */
235  M_SPARCLET_3 = 179,	/* 0xb3, reserved */
236  M_SPARCLET_4 = 195,	/* 0xc3, reserved */
237  M_HP200 = 200,	/* HP 200 (68010) BSD binary */
238  M_HP300 = (300 % 256), /* HP 300 (68020+68881) BSD binary */
239  M_HPUX = (0x20c % 256), /* HP 200/300 HPUX binary */
240  M_SPARCLET_5 = 211,	/* 0xd3, reserved */
241  M_SPARCLET_6 = 227,	/* 0xe3, reserved */
242  M_SPARCLET_7 = 243	/* 0xf3, reserved */
243};
244
245#define N_DYNAMIC(exec) ((exec).a_info & 0x80000000)
246
247#ifndef N_MAGIC
248# define N_MAGIC(exec) ((exec).a_info & 0xffff)
249#endif
250
251#ifndef N_MACHTYPE
252# define N_MACHTYPE(exec) ((enum machine_type)(((exec).a_info >> 16) & 0xff))
253#endif
254
255#ifndef N_FLAGS
256# define N_FLAGS(exec) (((exec).a_info >> 24) & 0xff)
257#endif
258
259#ifndef N_SET_INFO
260# define N_SET_INFO(exec, magic, type, flags) \
261((exec).a_info = ((magic) & 0xffff) \
262 | (((int)(type) & 0xff) << 16) \
263 | (((flags) & 0xff) << 24))
264#endif
265
266#ifndef N_SET_DYNAMIC
267# define N_SET_DYNAMIC(exec, dynamic) \
268((exec).a_info = (dynamic) ? ((exec).a_info | 0x80000000) : \
269((exec).a_info & 0x7fffffff))
270#endif
271
272#ifndef N_SET_MAGIC
273# define N_SET_MAGIC(exec, magic) \
274((exec).a_info = (((exec).a_info & 0xffff0000) | ((magic) & 0xffff)))
275#endif
276
277#ifndef N_SET_MACHTYPE
278# define N_SET_MACHTYPE(exec, machtype) \
279((exec).a_info = \
280 ((exec).a_info&0xff00ffff) | ((((int)(machtype))&0xff) << 16))
281#endif
282
283#ifndef N_SET_FLAGS
284# define N_SET_FLAGS(exec, flags) \
285((exec).a_info = \
286 ((exec).a_info&0x00ffffff) | (((flags) & 0xff) << 24))
287#endif
288
289typedef struct aout_symbol {
290  asymbol symbol;
291  short desc;
292  char other;
293  unsigned char type;
294} aout_symbol_type;
295
296/* The `tdata' struct for all a.out-like object file formats.
297   Various things depend on this struct being around any time an a.out
298   file is being handled.  An example is dbxread.c in GDB.  */
299
300struct aoutdata {
301  struct internal_exec *hdr;		/* exec file header */
302  aout_symbol_type *symbols;		/* symtab for input bfd */
303
304  /* For ease, we do this */
305  asection *textsec;
306  asection *datasec;
307  asection *bsssec;
308
309  /* We remember these offsets so that after check_file_format, we have
310     no dependencies on the particular format of the exec_hdr.  */
311  file_ptr sym_filepos;
312  file_ptr str_filepos;
313
314  /* Size of a relocation entry in external form */
315  unsigned reloc_entry_size;
316
317  /* Size of a symbol table entry in external form */
318  unsigned symbol_entry_size;
319
320  /* Page size - needed for alignment of demand paged files. */
321  unsigned long page_size;
322
323  /* Segment size - needed for alignment of demand paged files. */
324  unsigned long segment_size;
325
326  /* Zmagic disk block size - need to align the start of the text
327     section in ZMAGIC binaries.  Normally the same as page_size.  */
328  unsigned long zmagic_disk_block_size;
329
330  unsigned exec_bytes_size;
331  unsigned vma_adjusted : 1;
332
333  /* used when a bfd supports several highly similar formats */
334  enum
335    {
336      default_format = 0,
337      /* Used on HP 9000/300 running HP/UX.  See hp300hpux.c.  */
338      gnu_encap_format,
339      /* Used on Linux, 386BSD, etc.  See include/aout/aout64.h.  */
340      q_magic_format
341    } subformat;
342
343  enum
344    {
345      undecided_magic = 0,
346      z_magic,
347      o_magic,
348      n_magic
349    } magic;
350
351  /* A buffer for find_nearest_line.  */
352  char *line_buf;
353
354  /* The external symbol information.  */
355  struct external_nlist *external_syms;
356  bfd_size_type external_sym_count;
357  bfd_window sym_window;
358  char *external_strings;
359  bfd_size_type external_string_size;
360  bfd_window string_window;
361  struct aout_link_hash_entry **sym_hashes;
362
363  /* A pointer for shared library information.  */
364  PTR dynamic_info;
365
366  /* A mapping from local symbols to offsets into the global offset
367     table, used when linking on SunOS.  This is indexed by the symbol
368     index.  */
369  bfd_vma *local_got_offsets;
370};
371
372struct  aout_data_struct {
373    struct aoutdata a;
374    struct internal_exec e;
375};
376
377#define	adata(bfd)		((bfd)->tdata.aout_data->a)
378#define	exec_hdr(bfd)		(adata(bfd).hdr)
379#define	obj_aout_symbols(bfd)	(adata(bfd).symbols)
380#define	obj_textsec(bfd)	(adata(bfd).textsec)
381#define	obj_datasec(bfd)	(adata(bfd).datasec)
382#define	obj_bsssec(bfd)		(adata(bfd).bsssec)
383#define	obj_sym_filepos(bfd)	(adata(bfd).sym_filepos)
384#define	obj_str_filepos(bfd)	(adata(bfd).str_filepos)
385#define	obj_reloc_entry_size(bfd) (adata(bfd).reloc_entry_size)
386#define	obj_symbol_entry_size(bfd) (adata(bfd).symbol_entry_size)
387#define obj_aout_subformat(bfd)	(adata(bfd).subformat)
388#define obj_aout_external_syms(bfd) (adata(bfd).external_syms)
389#define obj_aout_external_sym_count(bfd) (adata(bfd).external_sym_count)
390#define obj_aout_sym_window(bfd) (adata(bfd).sym_window)
391#define obj_aout_external_strings(bfd) (adata(bfd).external_strings)
392#define obj_aout_external_string_size(bfd) (adata(bfd).external_string_size)
393#define obj_aout_string_window(bfd) (adata(bfd).string_window)
394#define obj_aout_sym_hashes(bfd) (adata(bfd).sym_hashes)
395#define obj_aout_dynamic_info(bfd) (adata(bfd).dynamic_info)
396
397/* We take the address of the first element of an asymbol to ensure that the
398   macro is only ever applied to an asymbol */
399#define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd))
400
401/* Information we keep for each a.out section.  This is currently only
402   used by the a.out backend linker.  */
403
404struct aout_section_data_struct
405{
406  /* The unswapped relocation entries for this section.  */
407  PTR relocs;
408};
409
410#define aout_section_data(s) \
411  ((struct aout_section_data_struct *) (s)->used_by_bfd)
412
413#define set_aout_section_data(s,v) \
414  ((s)->used_by_bfd = (PTR)&(v)->relocs)
415
416/* Prototype declarations for functions defined in aoutx.h  */
417
418boolean
419NAME(aout,squirt_out_relocs) PARAMS ((bfd *abfd, asection *section));
420
421boolean
422NAME(aout,make_sections) PARAMS ((bfd *));
423
424const bfd_target *
425NAME(aout,some_aout_object_p) PARAMS ((bfd *abfd,
426				       struct internal_exec *execp,
427				       const bfd_target *(*callback)(bfd *)));
428
429boolean
430NAME(aout,mkobject) PARAMS ((bfd *abfd));
431
432enum machine_type
433NAME(aout,machine_type) PARAMS ((enum bfd_architecture arch,
434				 unsigned long machine,
435				 boolean *unknown));
436
437boolean
438NAME(aout,set_arch_mach) PARAMS ((bfd *abfd, enum bfd_architecture arch,
439		 		  unsigned long machine));
440
441boolean
442NAME(aout,new_section_hook) PARAMS ((bfd *abfd, asection *newsect));
443
444boolean
445NAME(aout,set_section_contents) PARAMS ((bfd *abfd, sec_ptr section,
446			 PTR location, file_ptr offset, bfd_size_type count));
447
448asymbol *
449NAME(aout,make_empty_symbol) PARAMS ((bfd *abfd));
450
451boolean
452NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *,
453					   struct external_nlist *,
454					   bfd_size_type, char *,
455					   bfd_size_type,
456					   boolean dynamic));
457
458boolean
459NAME(aout,slurp_symbol_table) PARAMS ((bfd *abfd));
460
461boolean
462NAME(aout,write_syms) PARAMS ((bfd *abfd));
463
464void
465NAME(aout,reclaim_symbol_table) PARAMS ((bfd *abfd));
466
467long
468NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *abfd));
469
470long
471NAME(aout,get_symtab) PARAMS ((bfd *abfd, asymbol **location));
472
473void
474NAME(aout,swap_ext_reloc_in) PARAMS ((bfd *, struct reloc_ext_external *,
475				      arelent *, asymbol **, bfd_size_type));
476void
477NAME(aout,swap_std_reloc_in) PARAMS ((bfd *, struct reloc_std_external *,
478				      arelent *, asymbol **, bfd_size_type));
479
480reloc_howto_type *
481NAME(aout,reloc_type_lookup) PARAMS ((bfd *abfd,
482				      bfd_reloc_code_real_type code));
483
484boolean
485NAME(aout,slurp_reloc_table) PARAMS ((bfd *abfd, sec_ptr asect,
486				      asymbol **symbols));
487
488long
489NAME(aout,canonicalize_reloc) PARAMS ((bfd *abfd, sec_ptr section,
490				       arelent **relptr, asymbol **symbols));
491
492long
493NAME(aout,get_reloc_upper_bound) PARAMS ((bfd *abfd, sec_ptr asect));
494
495void
496NAME(aout,reclaim_reloc) PARAMS ((bfd *ignore_abfd, sec_ptr ignore));
497
498alent *
499NAME(aout,get_lineno) PARAMS ((bfd *ignore_abfd, asymbol *ignore_symbol));
500
501void
502NAME(aout,print_symbol) PARAMS ((bfd *ignore_abfd, PTR file,
503			    asymbol *symbol, bfd_print_symbol_type how));
504
505void
506NAME(aout,get_symbol_info) PARAMS ((bfd *ignore_abfd,
507                           asymbol *symbol, symbol_info *ret));
508
509boolean
510NAME(aout,find_nearest_line) PARAMS ((bfd *abfd, asection *section,
511      asymbol **symbols, bfd_vma offset, CONST char **filename_ptr,
512      CONST char **functionname_ptr, unsigned int *line_ptr));
513
514long
515NAME(aout,read_minisymbols) PARAMS ((bfd *, boolean, PTR *, unsigned int *));
516
517asymbol *
518NAME(aout,minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR,
519					 asymbol *));
520
521int
522NAME(aout,sizeof_headers) PARAMS ((bfd *abfd, boolean exec));
523
524boolean
525NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *abfd,
526       bfd_size_type *text_size, file_ptr *text_end));
527
528void
529NAME(aout,swap_exec_header_in) PARAMS ((bfd *abfd,
530       struct external_exec *raw_bytes, struct internal_exec *execp));
531
532void
533NAME(aout,swap_exec_header_out) PARAMS ((bfd *abfd,
534       struct internal_exec *execp, struct external_exec *raw_bytes));
535
536struct bfd_hash_entry *
537NAME(aout,link_hash_newfunc)
538  PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
539
540boolean
541NAME(aout,link_hash_table_init)
542     PARAMS ((struct aout_link_hash_table *, bfd *,
543	      struct bfd_hash_entry *(*) (struct bfd_hash_entry *,
544					  struct bfd_hash_table *,
545					  const char *)));
546
547struct bfd_link_hash_table *
548NAME(aout,link_hash_table_create) PARAMS ((bfd *));
549
550boolean
551NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *));
552
553boolean
554NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *,
555			       void (*) (bfd *, file_ptr *, file_ptr *,
556					 file_ptr *)));
557
558boolean
559NAME(aout,bfd_free_cached_info) PARAMS ((bfd *));
560
561/* A.out uses the generic versions of these routines... */
562
563#define	aout_32_get_section_contents	_bfd_generic_get_section_contents
564
565#define	aout_64_get_section_contents	_bfd_generic_get_section_contents
566#ifndef NO_WRITE_HEADER_KLUDGE
567#define NO_WRITE_HEADER_KLUDGE 0
568#endif
569
570#ifndef aout_32_bfd_is_local_label_name
571#define aout_32_bfd_is_local_label_name bfd_generic_is_local_label_name
572#endif
573
574#ifndef WRITE_HEADERS
575#define WRITE_HEADERS(abfd, execp)					      \
576      {									      \
577	bfd_size_type text_size; /* dummy vars */			      \
578	file_ptr text_end;						      \
579	if (adata(abfd).magic == undecided_magic)			      \
580	  NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end);     \
581    									      \
582	execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;	      \
583	execp->a_entry = bfd_get_start_address (abfd);			      \
584    									      \
585	execp->a_trsize = ((obj_textsec (abfd)->reloc_count) *		      \
586			   obj_reloc_entry_size (abfd));		      \
587	execp->a_drsize = ((obj_datasec (abfd)->reloc_count) *		      \
588			   obj_reloc_entry_size (abfd));		      \
589	NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes);	      \
590									      \
591	if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false;	      \
592	if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)	      \
593	    != EXEC_BYTES_SIZE)						      \
594	  return false;							      \
595	/* Now write out reloc info, followed by syms and strings */	      \
596  									      \
597	if (bfd_get_outsymbols (abfd) != (asymbol **) NULL		      \
598	    && bfd_get_symcount (abfd) != 0) 				      \
599	  {								      \
600	    if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET) != 0) \
601	      return false;						      \
602									      \
603	    if (! NAME(aout,write_syms)(abfd)) return false;		      \
604	  }								      \
605									      \
606	if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET) != 0)    \
607	  return false;						      	      \
608	if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd)))         \
609	  return false;						      	      \
610									      \
611	if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) != 0)    \
612	  return false;						      	      \
613	if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd)))          \
614	  return false;						      	      \
615      }
616#endif
617
618#endif /* ! defined (LIBAOUT_H) */
619