[lit] Add argument check: --timeout must be non-negative integer
[llvm-core.git] / tools / llvm-objcopy / ELF / ELFConfig.h
blob977efbc4166fa1dbe0c7e1d6f80215dc6318a765
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 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_TOOLS_OBJCOPY_ELFCONFIG_H
10 #define LLVM_TOOLS_OBJCOPY_ELFCONFIG_H
12 #include "llvm/ADT/Optional.h"
13 #include "llvm/ADT/StringRef.h"
14 #include "llvm/Object/ELFTypes.h"
15 #include "llvm/Support/Error.h"
16 #include <vector>
18 namespace llvm {
19 namespace objcopy {
20 struct CopyConfig;
22 namespace elf {
24 struct NewSymbolInfo {
25 StringRef SymbolName;
26 StringRef SectionName;
27 uint64_t Value = 0;
28 uint8_t Type = ELF::STT_NOTYPE;
29 uint8_t Bind = ELF::STB_GLOBAL;
30 uint8_t Visibility = ELF::STV_DEFAULT;
33 struct ELFCopyConfig {
34 Optional<uint8_t> NewSymbolVisibility;
35 std::vector<NewSymbolInfo> SymbolsToAdd;
38 Expected<ELFCopyConfig> parseConfig(const CopyConfig &Config);
40 } // namespace elf
41 } // namespace objcopy
42 } // namespace llvm
44 #endif