Commit | Line | Data |
---|---|---|
252b5132 | 1 | /* BFD back-end for i386 a.out binaries. |
82704155 | 2 | Copyright (C) 1990-2019 Free Software Foundation, Inc. |
252b5132 | 3 | |
7920ce38 | 4 | This file is part of BFD, the Binary File Descriptor library. |
252b5132 | 5 | |
7920ce38 NC |
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 | |
cd123cb7 | 8 | the Free Software Foundation; either version 3 of the License, or |
7920ce38 | 9 | (at your option) any later version. |
252b5132 | 10 | |
7920ce38 NC |
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. | |
252b5132 | 15 | |
7920ce38 NC |
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 | |
cd123cb7 NC |
18 | Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, |
19 | MA 02110-1301, USA. */ | |
20 | ||
252b5132 | 21 | |
dc810e39 | 22 | /* The only 386 aout system we have here is GO32 from DJ. |
252b5132 RH |
23 | These numbers make BFD work with that. If your aout 386 system |
24 | doesn't work with these, we'll have to split them into different | |
25 | files. Send me (sac@cygnus.com) the runes to make it work on your | |
26 | system, and I'll stick it in for the next release. */ | |
27 | ||
7920ce38 | 28 | #define N_HEADER_IN_TEXT(x) 0 |
07d6d2b8 AM |
29 | #define N_TXTOFF(x) 0x20 |
30 | #define N_TXTADDR(x) (N_MAGIC (x) == ZMAGIC ? 0x1020 : 0) | |
31 | #define N_TXTSIZE(x) ((x)->a_text) | |
32 | #define TARGET_PAGE_SIZE 4096 | |
33 | #define SEGMENT_SIZE 0x400000 | |
34 | #define DEFAULT_ARCH bfd_arch_i386 | |
252b5132 | 35 | |
e43d48cc AM |
36 | /* Do not "beautify" the CONCAT* macro args. Traditional C will not |
37 | remove whitespace added here, and thus will fail to concatenate | |
38 | the tokens. */ | |
6d00b590 | 39 | #define MY(OP) CONCAT2 (i386_aout_,OP) |
252b5132 RH |
40 | #define TARGETNAME "a.out-i386" |
41 | #define NO_WRITE_HEADER_KLUDGE 1 | |
42 | ||
252b5132 | 43 | #include "sysdep.h" |
3db64b00 | 44 | #include "bfd.h" |
252b5132 RH |
45 | #include "libbfd.h" |
46 | #include "aout/aout64.h" | |
47 | #include "libaout.h" | |
48 | ||
49 | /* Set the machine type correctly. */ | |
50 | ||
b34976b6 | 51 | static bfd_boolean |
7920ce38 | 52 | i386aout_write_object_contents (bfd *abfd) |
252b5132 RH |
53 | { |
54 | struct external_exec exec_bytes; | |
55 | struct internal_exec *execp = exec_hdr (abfd); | |
56 | ||
bbb1afc8 | 57 | N_SET_MACHTYPE (execp, M_386); |
252b5132 RH |
58 | |
59 | obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; | |
60 | ||
61 | WRITE_HEADERS (abfd, execp); | |
62 | ||
b34976b6 | 63 | return TRUE; |
252b5132 RH |
64 | } |
65 | ||
7920ce38 | 66 | #define MY_write_object_contents i386aout_write_object_contents |
07d6d2b8 | 67 | #define MY_backend_data & MY (backend_data) |
7920ce38 NC |
68 | |
69 | static const struct aout_backend_data MY (backend_data); | |
252b5132 RH |
70 | |
71 | #include "aout-target.h" | |
7920ce38 NC |
72 | |
73 | static const struct aout_backend_data MY (backend_data) = | |
74 | { | |
75 | 0, /* Zmagic contiguous. */ | |
76 | 1, /* Text incl header. */ | |
77 | 0, /* Entry is text address. */ | |
78 | 0, /* Exec_hdr_flags. */ | |
79 | 0, /* Text vma? */ | |
80 | MY (set_sizes), | |
81 | 1, /* Exec header not counted. */ | |
82 | 0, /* Add_dynamic_symbols. */ | |
83 | 0, /* Add_one_symbol. */ | |
84 | 0, /* Link_dynamic_object. */ | |
85 | 0, /* Write_dynamic_symbol. */ | |
86 | 0, /* Check_dynamic_reloc. */ | |
87 | 0 /* Finish_dynamic_link. */ | |
88 | }; |