summaryrefslogtreecommitdiff
path: root/include/mcld/MC/ZOption.h
blob: d9cd635732b924c693aede6cf87f3388197f35d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//===- ZOption.h ----------------------------------------------------------===//
//
//                     The MCLinker Project
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#ifndef MCLD_MC_ZOPTION_H
#define MCLD_MC_ZOPTION_H
#ifdef ENABLE_UNITTEST
#include <gtest.h>
#endif

#include <llvm/Support/DataTypes.h>

namespace mcld {

/** \class ZOption
 *  \brief The -z options for GNU ld compatibility.
 */
class ZOption
{
public:
  enum Kind {
    CombReloc,
    NoCombReloc,
    Defs,
    ExecStack,
    NoExecStack,
    InitFirst,
    InterPose,
    LoadFltr,
    MulDefs,
    NoCopyReloc,
    NoDefaultLib,
    NoDelete,
    NoDLOpen,
    NoDump,
    Relro,
    NoRelro,
    Lazy,
    Now,
    Origin,
    CommPageSize,
    MaxPageSize,
    Unknown
  };

public:
  ZOption();

  Kind kind() const { return m_Kind; }

  void setKind(Kind pKind) { m_Kind = pKind; }

  uint64_t pageSize() const { return m_PageSize; }

  void setPageSize(uint64_t pPageSize) { m_PageSize = pPageSize; }

private:
  Kind m_Kind;
  uint64_t m_PageSize;
};

} // namespace of mcld

#endif