• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- X86GNUInfo.h -------------------------------------------------------===//
2 //
3 //                     The MCLinker Project
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #ifndef TARGET_X86_X86GNUINFO_H_
10 #define TARGET_X86_X86GNUINFO_H_
11 #include "mcld/Target/GNUInfo.h"
12 
13 #include <llvm/Support/ELF.h>
14 
15 namespace mcld {
16 
17 class X86_32GNUInfo : public GNUInfo {
18  public:
X86_32GNUInfo(const llvm::Triple & pTriple)19   explicit X86_32GNUInfo(const llvm::Triple& pTriple) : GNUInfo(pTriple) {}
20 
machine()21   uint32_t machine() const { return llvm::ELF::EM_386; }
22 
defaultTextSegmentAddr()23   uint64_t defaultTextSegmentAddr() const { return 0x08048000; }
24 
25   /// flags - the value of ElfXX_Ehdr::e_flags
26   /// FIXME
flags()27   uint64_t flags() const { return 0x0; }
28 };
29 
30 class X86_64GNUInfo : public GNUInfo {
31  public:
X86_64GNUInfo(const llvm::Triple & pTriple)32   explicit X86_64GNUInfo(const llvm::Triple& pTriple) : GNUInfo(pTriple) {}
33 
machine()34   uint32_t machine() const { return llvm::ELF::EM_X86_64; }
35 
defaultTextSegmentAddr()36   uint64_t defaultTextSegmentAddr() const { return 0x400000; }
37 
38   /// flags - the value of ElfXX_Ehdr::e_flags
39   /// FIXME
flags()40   uint64_t flags() const { return 0x0; }
41 };
42 
43 }  // namespace mcld
44 
45 #endif  // TARGET_X86_X86GNUINFO_H_
46