1 //===- MipsGNUInfo.cpp ----------------------------------------------------===//
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 #include "MipsGNUInfo.h"
10 
11 namespace mcld {
12 
13 //===----------------------------------------------------------------------===//
14 // MipsGNUInfo
15 //===----------------------------------------------------------------------===//
MipsGNUInfo(const llvm::Triple & pTriple)16 MipsGNUInfo::MipsGNUInfo(const llvm::Triple& pTriple)
17     : GNUInfo(pTriple), m_ABIVersion(0), m_ElfFlags(0) {
18 }
19 
setABIVersion(uint8_t ver)20 void MipsGNUInfo::setABIVersion(uint8_t ver) {
21   m_ABIVersion = ver;
22 }
23 
setElfFlags(uint64_t flags)24 void MipsGNUInfo::setElfFlags(uint64_t flags) {
25   m_ElfFlags = flags;
26 }
27 
machine() const28 uint32_t MipsGNUInfo::machine() const {
29   return llvm::ELF::EM_MIPS;
30 }
31 
ABIVersion() const32 uint8_t MipsGNUInfo::ABIVersion() const {
33   return m_ABIVersion;
34 }
35 
defaultTextSegmentAddr() const36 uint64_t MipsGNUInfo::defaultTextSegmentAddr() const {
37   if (m_Triple.isArch32Bit())
38     return 0x400000;
39   else
40     return 0x120000000ull;
41 }
42 
flags() const43 uint64_t MipsGNUInfo::flags() const {
44   return m_ElfFlags;
45 }
46 
entry() const47 const char* MipsGNUInfo::entry() const {
48   return "__start";
49 }
50 
dyld() const51 const char* MipsGNUInfo::dyld() const {
52   return m_Triple.isArch32Bit() ? "/lib/ld.so.1" : "/lib64/ld.so.1";
53 }
54 
abiPageSize() const55 uint64_t MipsGNUInfo::abiPageSize() const {
56   return 0x10000;
57 }
58 
59 }  // namespace mcld
60