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