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