mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-19 23:23:38 -04:00
[llvm-objcopy] Add few file processing directives
Differential revision: https://reviews.llvm.org/D57877 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353521 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -226,9 +226,9 @@ static const MachineInfo &getOutputFormatMachineInfo(StringRef Format) {
|
||||
return Iter->getValue();
|
||||
}
|
||||
|
||||
static void addGlobalSymbolsFromFile(std::vector<NameOrRegex> &Symbols,
|
||||
BumpPtrAllocator &Alloc,
|
||||
StringRef Filename, bool UseRegex) {
|
||||
static void addSymbolsFromFile(std::vector<NameOrRegex> &Symbols,
|
||||
BumpPtrAllocator &Alloc, StringRef Filename,
|
||||
bool UseRegex) {
|
||||
StringSaver Saver(Alloc);
|
||||
SmallVector<StringRef, 16> Lines;
|
||||
auto BufOrErr = MemoryBuffer::getFile(Filename);
|
||||
@@ -445,17 +445,29 @@ DriverConfig parseObjcopyOptions(ArrayRef<const char *> ArgsArr) {
|
||||
InputArgs.hasArg(OBJCOPY_decompress_debug_sections);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbol))
|
||||
Config.SymbolsToLocalize.emplace_back(Arg->getValue(), UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_localize_symbols))
|
||||
addSymbolsFromFile(Config.SymbolsToLocalize, DC.Alloc, Arg->getValue(),
|
||||
UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_keep_global_symbol))
|
||||
Config.SymbolsToKeepGlobal.emplace_back(Arg->getValue(), UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_keep_global_symbols))
|
||||
addGlobalSymbolsFromFile(Config.SymbolsToKeepGlobal, DC.Alloc,
|
||||
Arg->getValue(), UseRegex);
|
||||
addSymbolsFromFile(Config.SymbolsToKeepGlobal, DC.Alloc, Arg->getValue(),
|
||||
UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_globalize_symbol))
|
||||
Config.SymbolsToGlobalize.emplace_back(Arg->getValue(), UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_globalize_symbols))
|
||||
addSymbolsFromFile(Config.SymbolsToGlobalize, DC.Alloc, Arg->getValue(),
|
||||
UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_weaken_symbol))
|
||||
Config.SymbolsToWeaken.emplace_back(Arg->getValue(), UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_weaken_symbols))
|
||||
addSymbolsFromFile(Config.SymbolsToWeaken, DC.Alloc, Arg->getValue(),
|
||||
UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_strip_symbol))
|
||||
Config.SymbolsToRemove.emplace_back(Arg->getValue(), UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_strip_symbols))
|
||||
addSymbolsFromFile(Config.SymbolsToRemove, DC.Alloc, Arg->getValue(),
|
||||
UseRegex);
|
||||
for (auto Arg : InputArgs.filtered(OBJCOPY_keep_symbol))
|
||||
Config.SymbolsToKeep.emplace_back(Arg->getValue(), UseRegex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user