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_LLVM_OBJCOPY_ELF_ELFCONFIG_H 10 #define LLVM_TOOLS_LLVM_OBJCOPY_ELF_ELFCONFIG_H 11 12 #include "llvm/ADT/Optional.h" 13 #include "llvm/ADT/StringRef.h" 14 #include "llvm/Object/ELFTypes.h" 15 #include <vector> 16 17 namespace llvm { 18 namespace objcopy { 19 20 struct NewSymbolInfo { 21 StringRef SymbolName; 22 StringRef SectionName; 23 uint64_t Value = 0; 24 uint8_t Type = ELF::STT_NOTYPE; 25 uint8_t Bind = ELF::STB_GLOBAL; 26 uint8_t Visibility = ELF::STV_DEFAULT; 27 }; 28 29 // ELF specific configuration for copying/stripping a single file. 30 struct ELFConfig { 31 Optional<uint8_t> NewSymbolVisibility; 32 std::vector<NewSymbolInfo> SymbolsToAdd; 33 }; 34 35 } // namespace objcopy 36 } // namespace llvm 37 38 #endif // LLVM_TOOLS_LLVM_OBJCOPY_ELF_ELFCONFIG_H 39