ZOption.h revision affc150dc44fab1911775a49636d0ce85333b634
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_ZOPTION_H
10#define MCLD_ZOPTION_H
11#ifdef ENABLE_UNITTEST
12#include <gtest.h>
13#endif
14#include <llvm/Support/DataTypes.h>
15
16namespace mcld
17{
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  ~ZOption();
54
55  Kind kind() const
56  { return m_Kind; }
57
58  uint64_t pageSize() const
59  { return m_PageSize; }
60
61  void setKind(Kind pKind)
62  { m_Kind = pKind; }
63
64  void setPageSize(uint64_t pPageSize)
65  { m_PageSize = pPageSize; }
66
67private:
68  Kind m_Kind;
69  uint64_t m_PageSize;
70};
71
72} // namespace of mcld
73
74#endif
75
76