xref: /llvm-project/llvm/include/llvm/ObjCopy/ELF/ELFConfig.h (revision 10772807ab72ce2b68d76816f8753219b2acbac3)
1 //===- ELFConfig.h ----------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_OBJCOPY_ELF_ELFCONFIG_H
10 #define LLVM_OBJCOPY_ELF_ELFCONFIG_H
11 
12 #include "llvm/ObjCopy/CommonConfig.h"
13 #include "llvm/Object/ELFTypes.h"
14 
15 namespace llvm {
16 namespace objcopy {
17 
18 // Note to remove info specified by --remove-note option.
19 struct RemoveNoteInfo {
20   StringRef Name;
21   uint32_t TypeId;
22 };
23 
24 // ELF specific configuration for copying/stripping a single file.
25 struct ELFConfig {
26   uint8_t NewSymbolVisibility = (uint8_t)ELF::STV_DEFAULT;
27 
28   std::vector<std::pair<NameMatcher, uint8_t>> SymbolsToSetVisibility;
29 
30   // ELF entry point address expression. The input parameter is an entry point
31   // address in the input ELF file. The entry address in the output file is
32   // calculated with EntryExpr(input_address), when either --set-start or
33   // --change-start is used.
34   std::function<uint64_t(uint64_t)> EntryExpr;
35 
36   bool AllowBrokenLinks = false;
37   bool KeepFileSymbols = false;
38   bool LocalizeHidden = false;
39   bool VerifyNoteSections = true;
40 
41   // Notes specified by --remove-note option.
42   SmallVector<RemoveNoteInfo, 0> NotesToRemove;
43 };
44 
45 } // namespace objcopy
46 } // namespace llvm
47 
48 #endif // LLVM_OBJCOPY_ELF_ELFCONFIG_H
49