]>
Commit | Line | Data |
---|---|---|
14bfc3f5 ILT |
1 | // i386.cc -- i386 target support for gold. |
2 | ||
3 | #include "gold.h" | |
4 | #include "elfcpp.h" | |
5 | #include "target.h" | |
6 | #include "target-select.h" | |
7 | ||
8 | namespace | |
9 | { | |
10 | ||
11 | using namespace gold; | |
12 | ||
13 | // The i386 target class. | |
14 | ||
15 | class Target_i386 : public Sized_target<32, false> | |
16 | { | |
17 | public: | |
18 | Target_i386() | |
75f65a3e | 19 | : Sized_target<32, false>(&i386_info) |
14bfc3f5 | 20 | { } |
75f65a3e ILT |
21 | |
22 | private: | |
23 | static const Target::Target_info i386_info; | |
24 | }; | |
25 | ||
26 | const Target::Target_info Target_i386::i386_info = | |
27 | { | |
28 | 32, // size | |
29 | false, // is_big_endian | |
30 | false, // has_make_symbol | |
31 | false, // has_resolve, | |
32 | 0x08048000, // text_segment_address, | |
33 | 0x1000, // abi_pagesize | |
34 | 0x1000 // common_pagesize | |
14bfc3f5 ILT |
35 | }; |
36 | ||
37 | // The selector for i386 object files. | |
38 | ||
39 | class Target_selector_i386 : public Target_selector | |
40 | { | |
41 | public: | |
42 | Target_selector_i386() | |
43 | : Target_selector(elfcpp::EM_386, 32, false) | |
44 | { } | |
45 | ||
46 | Target* | |
47 | recognize(int machine, int osabi, int abiversion) const; | |
48 | }; | |
49 | ||
50 | // Recognize an i386 object file when we already know that the machine | |
51 | // number is EM_386. | |
52 | ||
53 | Target* | |
54 | Target_selector_i386::recognize(int, int, int) const | |
55 | { | |
56 | return new Target_i386(); | |
57 | } | |
58 | ||
59 | Target_selector_i386 target_selector_i386; | |
60 | ||
61 | } // End anonymous namespace. |