1 : // Copyright 2012 Google Inc.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Defines the RelinkApp class, which implements the command-line relink tool.
16 :
17 : #ifndef SYZYGY_RELINK_RELINK_APP_H_
18 : #define SYZYGY_RELINK_RELINK_APP_H_
19 :
20 : #include "base/command_line.h"
21 : #include "base/file_path.h"
22 : #include "base/string_piece.h"
23 : #include "base/time.h"
24 : #include "syzygy/common/application.h"
25 :
26 : namespace relink {
27 :
28 : // This class implements the command-line relink utility.
29 : class RelinkApp : public common::AppImplBase {
30 : public:
31 : RelinkApp()
32 : : AppImplBase("Relinker"),
33 : seed_(0),
34 : padding_(0),
35 : no_augment_pdb_(false),
36 : compress_pdb_(false),
37 : no_strip_strings_(false),
38 : output_metadata_(false),
39 : overwrite_(false),
40 : basic_blocks_(false),
41 E : exclude_bb_padding_(false) {
42 E : }
43 :
44 : // @name Implementation of the AppImplBase interface.
45 : // @{
46 : bool ParseCommandLine(const CommandLine* command_line);
47 : bool SetUp();
48 : int Run();
49 : // @}
50 :
51 : protected:
52 : // @name Utility members.
53 : // @{
54 : bool Usage(const CommandLine* command_line,
55 : const base::StringPiece& message) const;
56 : // @}
57 :
58 : // @name Command-line parameters.
59 : // @{
60 : FilePath input_dll_path_;
61 : FilePath input_pdb_path_;
62 : FilePath output_dll_path_;
63 : FilePath output_pdb_path_;
64 : FilePath order_file_path_;
65 : uint32 seed_;
66 : size_t padding_;
67 : bool no_augment_pdb_;
68 : bool compress_pdb_;
69 : bool no_strip_strings_;
70 : bool output_metadata_;
71 : bool overwrite_;
72 : bool basic_blocks_;
73 : bool exclude_bb_padding_;
74 : // @}
75 :
76 : private:
77 : DISALLOW_COPY_AND_ASSIGN(RelinkApp);
78 : };
79 :
80 : } // namespace relink
81 :
82 : #endif // SYZYGY_RELINK_RELINK_APP_H_
|