1 //===- GNUInfo.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 "mcld/Target/GNUInfo.h"
10 
11 namespace mcld {
12 
13 //===----------------------------------------------------------------------===//
14 // GNUInfo
15 //===----------------------------------------------------------------------===//
GNUInfo(const llvm::Triple & pTriple)16 GNUInfo::GNUInfo(const llvm::Triple& pTriple) : m_Triple(pTriple) {
17 }
18 
OSABI() const19 uint8_t GNUInfo::OSABI() const {
20   switch (m_Triple.getOS()) {
21     case llvm::Triple::FreeBSD:
22       return llvm::ELF::ELFOSABI_FREEBSD;
23     case llvm::Triple::Linux:
24       return llvm::ELF::ELFOSABI_LINUX;
25     default:
26       return llvm::ELF::ELFOSABI_NONE;
27   }
28 }
29 
30 }  // namespace mcld
31