blob: 66ffa65a2223171d717da616b9e90f06a314cb09 [file] [log] [blame]
Rui Ueyama411c63602015-05-28 19:09:30 +00001//===- Config.h -----------------------------------------------------------===//
2//
3// The LLVM Linker
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef LLD_COFF_CONFIG_H
11#define LLD_COFF_CONFIG_H
12
13#include "llvm/ADT/StringRef.h"
Rui Ueyama3d3e6fb2015-05-29 16:06:00 +000014#include "llvm/Object/COFF.h"
Rui Ueyama411c63602015-05-28 19:09:30 +000015#include <cstdint>
16#include <set>
17#include <string>
18
19namespace lld {
20namespace coff {
21
Rui Ueyama15cc47e2015-05-29 16:34:31 +000022using llvm::COFF::WindowsSubsystem;
Rui Ueyamad21b00b2015-05-31 19:17:14 +000023using llvm::StringRef;
Rui Ueyama15cc47e2015-05-29 16:34:31 +000024
Rui Ueyama411c63602015-05-28 19:09:30 +000025class Configuration {
26public:
Rui Ueyama3d3e6fb2015-05-29 16:06:00 +000027 llvm::COFF::MachineTypes MachineType = llvm::COFF::IMAGE_FILE_MACHINE_AMD64;
Rui Ueyama411c63602015-05-28 19:09:30 +000028 bool Verbose = false;
Rui Ueyama3ee0fe42015-05-31 03:55:46 +000029 WindowsSubsystem Subsystem = llvm::COFF::IMAGE_SUBSYSTEM_UNKNOWN;
Rui Ueyamaeb262ce2015-06-04 02:12:16 +000030 StringRef EntryName;
31
32 // Symbols in this set are considered as live by the garbage collector.
33 std::set<StringRef> GCRoots;
Rui Ueyamab41b7e52015-05-29 16:21:11 +000034
Rui Ueyamad21b00b2015-05-31 19:17:14 +000035 std::set<StringRef> NoDefaultLibs;
36 bool NoDefaultLibAll = false;
37
Rui Ueyama411c63602015-05-28 19:09:30 +000038 uint64_t ImageBase = 0x140000000;
Rui Ueyamab41b7e52015-05-29 16:21:11 +000039 uint64_t StackReserve = 1024 * 1024;
40 uint64_t StackCommit = 4096;
Rui Ueyamac377e9a2015-05-29 16:23:40 +000041 uint64_t HeapReserve = 1024 * 1024;
42 uint64_t HeapCommit = 4096;
Rui Ueyamab9dcdb52015-05-29 16:28:29 +000043 uint32_t MajorImageVersion = 0;
44 uint32_t MinorImageVersion = 0;
Rui Ueyama15cc47e2015-05-29 16:34:31 +000045 uint32_t MajorOSVersion = 6;
46 uint32_t MinorOSVersion = 0;
Rui Ueyama411c63602015-05-28 19:09:30 +000047};
48
49extern Configuration *Config;
50
51} // namespace coff
52} // namespace lld
53
54#endif