ZOption.h revision 87f34658dec9097d987d254a990ea7f311bfc95f
1//===- ZOption.h ----------------------------------------------------------===// 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#ifndef MCLD_MC_ZOPTION_H 10#define MCLD_MC_ZOPTION_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14 15#include <llvm/Support/DataTypes.h> 16 17namespace mcld { 18 19/** \class ZOption 20 * \brief The -z options for GNU ld compatibility. 21 */ 22class ZOption 23{ 24public: 25 enum Kind { 26 CombReloc, 27 NoCombReloc, 28 Defs, 29 ExecStack, 30 NoExecStack, 31 InitFirst, 32 InterPose, 33 LoadFltr, 34 MulDefs, 35 NoCopyReloc, 36 NoDefaultLib, 37 NoDelete, 38 NoDLOpen, 39 NoDump, 40 Relro, 41 NoRelro, 42 Lazy, 43 Now, 44 Origin, 45 CommPageSize, 46 MaxPageSize, 47 Unknown 48 }; 49 50public: 51 ZOption(); 52 53 Kind kind() const { return m_Kind; } 54 55 void setKind(Kind pKind) { m_Kind = pKind; } 56 57 uint64_t pageSize() const { return m_PageSize; } 58 59 void setPageSize(uint64_t pPageSize) { m_PageSize = pPageSize; } 60 61private: 62 Kind m_Kind; 63 uint64_t m_PageSize; 64}; 65 66} // namespace of mcld 67 68#endif 69 70