Home | History | Annotate | Download | only in Mips
      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 //===----------------------------------------------------------------------===//
     16 MipsGNUInfo::MipsGNUInfo(const llvm::Triple& pTriple)
     17     : GNUInfo(pTriple), m_ABIVersion(0), m_ElfFlags(0) {
     18 }
     19 
     20 void MipsGNUInfo::setABIVersion(uint8_t ver) {
     21   m_ABIVersion = ver;
     22 }
     23 
     24 void MipsGNUInfo::setElfFlags(uint64_t flags) {
     25   m_ElfFlags = flags;
     26 }
     27 
     28 uint32_t MipsGNUInfo::machine() const {
     29   return llvm::ELF::EM_MIPS;
     30 }
     31 
     32 uint8_t MipsGNUInfo::ABIVersion() const {
     33   return m_ABIVersion;
     34 }
     35 
     36 uint64_t MipsGNUInfo::defaultTextSegmentAddr() const {
     37   if (m_Triple.isArch32Bit())
     38     return 0x400000;
     39   else
     40     return 0x120000000ull;
     41 }
     42 
     43 uint64_t MipsGNUInfo::flags() const {
     44   return m_ElfFlags;
     45 }
     46 
     47 const char* MipsGNUInfo::entry() const {
     48   return "__start";
     49 }
     50 
     51 const char* MipsGNUInfo::dyld() const {
     52   return m_Triple.isArch32Bit() ? "/lib/ld.so.1" : "/lib64/ld.so.1";
     53 }
     54 
     55 uint64_t MipsGNUInfo::abiPageSize() const {
     56   return 0x10000;
     57 }
     58 
     59 }  // namespace mcld
     60