1 /* BFD back-end for linux flavored i386 a.out binaries.
2 Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
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 2 of the License, or
9 (at your option) any later version.
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.
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., 675 Mass Ave, Cambridge, MA 02139, USA. */
20 #define PAGE_SIZE 4096
21 #define ZMAGIC_DISK_BLOCK_SIZE 1024
22 #define SEGMENT_SIZE 4096
23 #define TEXT_START_ADDR 0x0
24 #define N_SHARED_LIB(x) 0
26 #define BYTES_IN_WORD 4
31 #include "aout/aout64.h"
32 #include "aout/stab_gnu.h"
34 #include "libaout.h" /* BFD a.out internal data structures */
36 #define DEFAULT_ARCH bfd_arch_i386
37 #define MY(OP) CAT(i386linux_,OP)
38 #define MY_text_includes_header 1
39 #define TARGETNAME "a.out-i386-linux"
41 /* We always generate QMAGIC files in preference to ZMAGIC files. It
42 would be possible to make this a linker option, if that ever
45 static void MY_final_link_callback
46 PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *));
49 i386linux_bfd_final_link (abfd, info)
51 struct bfd_link_info *info;
53 obj_aout_subformat (abfd) = q_magic_format;
54 return NAME(aout,final_link) (abfd, info, MY_final_link_callback);
57 #define MY_bfd_final_link i386linux_bfd_final_link
59 /* Set the machine type correctly. */
62 i386linux_write_object_contents (abfd)
65 struct external_exec exec_bytes;
66 struct internal_exec *execp = exec_hdr (abfd);
68 N_SET_MACHTYPE (*execp, M_386);
70 obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
72 WRITE_HEADERS(abfd, execp);
77 #define MY_write_object_contents i386linux_write_object_contents
79 #include "aout-target.h"