[llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Summary:
This patch splits the command-line parsing into two phases:
First, parse cross-platform options and leave ELF-specific options unparsed.
Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.
Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay
Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay
Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67139
llvm-svn: 372712
2019-09-24 17:38:23 +08:00
|
|
|
//===- ELFConfig.h ----------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2021-04-23 19:19:11 +08:00
|
|
|
#ifndef LLVM_TOOLS_LLVM_OBJCOPY_ELF_ELFCONFIG_H
|
|
|
|
#define LLVM_TOOLS_LLVM_OBJCOPY_ELF_ELFCONFIG_H
|
[llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Summary:
This patch splits the command-line parsing into two phases:
First, parse cross-platform options and leave ELF-specific options unparsed.
Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.
Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay
Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay
Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67139
llvm-svn: 372712
2019-09-24 17:38:23 +08:00
|
|
|
|
|
|
|
#include "llvm/ADT/Optional.h"
|
|
|
|
#include "llvm/ADT/StringRef.h"
|
|
|
|
#include "llvm/Object/ELFTypes.h"
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace objcopy {
|
|
|
|
|
2021-04-23 19:19:11 +08:00
|
|
|
// ELF specific configuration for copying/stripping a single file.
|
|
|
|
struct ELFConfig {
|
2021-05-27 19:07:35 +08:00
|
|
|
uint8_t NewSymbolVisibility = (uint8_t)ELF::STV_DEFAULT;
|
2021-09-08 02:13:28 +08:00
|
|
|
|
|
|
|
// ELF entry point address expression. The input parameter is an entry point
|
|
|
|
// address in the input ELF file. The entry address in the output file is
|
|
|
|
// calculated with EntryExpr(input_address), when either --set-start or
|
|
|
|
// --change-start is used.
|
|
|
|
std::function<uint64_t(uint64_t)> EntryExpr;
|
|
|
|
|
|
|
|
bool AllowBrokenLinks = false;
|
|
|
|
bool KeepFileSymbols = false;
|
|
|
|
bool LocalizeHidden = false;
|
[llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Summary:
This patch splits the command-line parsing into two phases:
First, parse cross-platform options and leave ELF-specific options unparsed.
Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.
Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay
Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay
Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67139
llvm-svn: 372712
2019-09-24 17:38:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace objcopy
|
|
|
|
} // namespace llvm
|
|
|
|
|
2021-04-23 19:19:11 +08:00
|
|
|
#endif // LLVM_TOOLS_LLVM_OBJCOPY_ELF_ELFCONFIG_H
|