• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- MipsGNUInfo.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 MCLD_TARGET_MIPS_GNU_INFO_H
10 #define MCLD_TARGET_MIPS_GNU_INFO_H
11 #include <mcld/Target/GNUInfo.h>
12 
13 #include <llvm/Support/ELF.h>
14 
15 namespace mcld {
16 
17 class MipsGNUInfo : public GNUInfo
18 {
19 public:
20   enum {
21     // The original o32 abi.
22     E_MIPS_ABI_O32    = 0x00001000,
23     // O32 extended to work on 64 bit architectures.
24     E_MIPS_ABI_O64    = 0x00002000,
25     // EABI in 32 bit mode.
26     E_MIPS_ABI_EABI32 = 0x00003000,
27     // EABI in 64 bit mode.
28     E_MIPS_ABI_EABI64 = 0x00004000
29   };
30 
31 public:
MipsGNUInfo(const llvm::Triple & pTriple)32   MipsGNUInfo(const llvm::Triple& pTriple) : GNUInfo(pTriple) { }
33 
machine()34   uint32_t machine() const { return llvm::ELF::EM_MIPS; }
35 
defaultTextSegmentAddr()36   uint64_t defaultTextSegmentAddr() const { return 0x80000; }
37 
flags()38   uint64_t flags() const
39   {
40     // TODO: (simon) The correct flag's set depend on command line
41     // arguments and flags from input .o files.
42     return llvm::ELF::EF_MIPS_ARCH_32R2 |
43            llvm::ELF::EF_MIPS_NOREORDER |
44            llvm::ELF::EF_MIPS_PIC |
45            llvm::ELF::EF_MIPS_CPIC |
46            E_MIPS_ABI_O32;
47   }
48 
abiPageSize()49   uint64_t abiPageSize() const { return 0x10000; }
50 };
51 
52 } // namespace of mcld
53 
54 #endif
55 
56