[PATCH] D113735: [llvm-obcopy][MachO] Add --prefix-symbols support
Keith Smiley via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 11 22:48:47 PST 2021
keith created this revision.
Herald added a reviewer: alexander-shaposhnikov.
Herald added a reviewer: rupprecht.
Herald added a reviewer: jhenderson.
keith requested review of this revision.
Herald added subscribers: llvm-commits, MaskRay.
Herald added a project: LLVM.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113735
Files:
llvm/tools/llvm-objcopy/ConfigManager.cpp
llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
Index: llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
===================================================================
--- llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
+++ llvm/tools/llvm-objcopy/MachO/MachOObjcopy.cpp
@@ -96,6 +96,9 @@
auto I = Config.SymbolsToRename.find(Sym.Name);
if (I != Config.SymbolsToRename.end())
Sym.Name = std::string(I->getValue());
+
+ if (!Config.SymbolsPrefix.empty() && !Sym.isUndefinedSymbol())
+ Sym.Name = (Config.SymbolsPrefix + Sym.Name).str();
}
auto RemovePred = [Config, MachOConfig,
Index: llvm/tools/llvm-objcopy/ConfigManager.cpp
===================================================================
--- llvm/tools/llvm-objcopy/ConfigManager.cpp
+++ llvm/tools/llvm-objcopy/ConfigManager.cpp
@@ -582,11 +582,11 @@
}
Expected<const MachOConfig &> ConfigManager::getMachOConfig() const {
- if (!Common.SplitDWO.empty() || !Common.SymbolsPrefix.empty() ||
- !Common.AllocSectionsPrefix.empty() || !Common.KeepSection.empty() ||
- !Common.SymbolsToGlobalize.empty() || !Common.SymbolsToKeep.empty() ||
- !Common.SymbolsToLocalize.empty() || !Common.SymbolsToWeaken.empty() ||
- !Common.SymbolsToKeepGlobal.empty() || !Common.SectionsToRename.empty() ||
+ if (!Common.SplitDWO.empty() || !Common.AllocSectionsPrefix.empty() ||
+ !Common.KeepSection.empty() || !Common.SymbolsToGlobalize.empty() ||
+ !Common.SymbolsToKeep.empty() || !Common.SymbolsToLocalize.empty() ||
+ !Common.SymbolsToWeaken.empty() || !Common.SymbolsToKeepGlobal.empty() ||
+ !Common.SectionsToRename.empty() ||
!Common.UnneededSymbolsToRemove.empty() ||
!Common.SetSectionAlignment.empty() || !Common.SetSectionFlags.empty() ||
Common.ExtractDWO || Common.PreserveDates || Common.StripAllGNU ||
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113735.386735.patch
Type: text/x-patch
Size: 1811 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211112/ab7be8d6/attachment.bin>
More information about the llvm-commits
mailing list