blob: 9a1804f808a71c7b4b4e9d5fd634af654f7e4f70 [file] [log] [blame]
Stephen Hinesf33f6de2014-02-14 18:00:16 -08001//===- 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)
Stephen Hinescfcb2242016-03-08 00:18:09 -080017 : GNUInfo(pTriple), m_ABIVersion(0), m_ElfFlags(0) {
Stephen Hines37b74a32014-11-26 18:48:20 -080018}
Stephen Hinesf33f6de2014-02-14 18:00:16 -080019
Stephen Hines37b74a32014-11-26 18:48:20 -080020void MipsGNUInfo::setABIVersion(uint8_t ver) {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080021 m_ABIVersion = ver;
22}
23
Stephen Hinescfcb2242016-03-08 00:18:09 -080024void MipsGNUInfo::setElfFlags(uint64_t flags) {
25 m_ElfFlags = flags;
Stephen Hinesf33f6de2014-02-14 18:00:16 -080026}
27
Stephen Hines37b74a32014-11-26 18:48:20 -080028uint32_t MipsGNUInfo::machine() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080029 return llvm::ELF::EM_MIPS;
30}
31
Stephen Hines37b74a32014-11-26 18:48:20 -080032uint8_t MipsGNUInfo::ABIVersion() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080033 return m_ABIVersion;
34}
35
Stephen Hines37b74a32014-11-26 18:48:20 -080036uint64_t MipsGNUInfo::defaultTextSegmentAddr() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080037 if (m_Triple.isArch32Bit())
38 return 0x400000;
39 else
40 return 0x120000000ull;
41}
42
Stephen Hines37b74a32014-11-26 18:48:20 -080043uint64_t MipsGNUInfo::flags() const {
Stephen Hinescfcb2242016-03-08 00:18:09 -080044 return m_ElfFlags;
Stephen Hinesf33f6de2014-02-14 18:00:16 -080045}
46
Stephen Hines37b74a32014-11-26 18:48:20 -080047const char* MipsGNUInfo::entry() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080048 return "__start";
49}
50
Stephen Hines37b74a32014-11-26 18:48:20 -080051const char* MipsGNUInfo::dyld() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080052 return m_Triple.isArch32Bit() ? "/lib/ld.so.1" : "/lib64/ld.so.1";
53}
54
Stephen Hines37b74a32014-11-26 18:48:20 -080055uint64_t MipsGNUInfo::abiPageSize() const {
Stephen Hinesf33f6de2014-02-14 18:00:16 -080056 return 0x10000;
57}
58
Stephen Hines37b74a32014-11-26 18:48:20 -080059} // namespace mcld