Home | History | Annotate | Download | only in Target
      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 using namespace mcld;
     12 
     13 //===----------------------------------------------------------------------===//
     14 // GNUInfo
     15 //===----------------------------------------------------------------------===//
     16 GNUInfo::GNUInfo(const llvm::Triple& pTriple)
     17   : m_Triple(pTriple) {
     18 }
     19 
     20 uint8_t GNUInfo::OSABI() const
     21 {
     22   switch (m_Triple.getOS()) {
     23     case llvm::Triple::FreeBSD:
     24       return llvm::ELF::ELFOSABI_FREEBSD;
     25     case llvm::Triple::Linux:
     26       return llvm::ELF::ELFOSABI_LINUX;
     27     default:
     28       return llvm::ELF::ELFOSABI_NONE;
     29   }
     30 }
     31 
     32