[llvm] Add functionality to llvm-objcopy to remove prefixes (PR #79415)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 31 22:27:05 PST 2024


================
@@ -329,6 +329,10 @@ static Error updateAndRemoveSymbols(const CommonConfig &Config,
     if (I != Config.SymbolsToRename.end())
       Sym.Name = std::string(I->getValue());
 
+    if (!Config.SymbolsPrefixRemove.empty() && Sym.Type != STT_SECTION)
----------------
MaskRay wrote:

We have similar confusion wrt `{add,rename,remove}-section` and I don't think there is a good way to completely remove confusion...

GNU objcopy does not make these operations form a total order, which is probably worse (i.e. `-A -B`=>op A runs before B. `-B -C` => B runs before C;  `-C -A` => C runs before A; where A/B/C refer to rename-section/add-section/set-section-flags.)

I am happy with the the current order. Users are expected to run llvm-objcopy multiple times if they are confused:)

https://github.com/llvm/llvm-project/pull/79415


More information about the llvm-commits mailing list