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_TOOLS_OBJCOPY_ELFCONFIG_H
10#define LLVM_TOOLS_OBJCOPY_ELFCONFIG_H
11
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>
17
18namespace llvm {
19namespace objcopy {
20struct CopyConfig;
21
22namespace elf {
23
24struct 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;
31};
32
33struct ELFCopyConfig {
34  Optional<uint8_t> NewSymbolVisibility;
35  std::vector<NewSymbolInfo> SymbolsToAdd;
36};
37
38Expected<ELFCopyConfig> parseConfig(const CopyConfig &Config);
39
40} // namespace elf
41} // namespace objcopy
42} // namespace llvm
43
44#endif
45