[llvm] [llvm-objcopy] Add --remove-symbol-prefix (PR #79415)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 6 00:46:55 PST 2024
================
@@ -0,0 +1,64 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --remove-symbol-prefix __pf_ %t %t2
+# RUN: llvm-readelf --symbols %t2 | FileCheck %s
+
+## Show that an empty string is permitted as the argument to
+## --remove-prefix-symbols.
+# RUN: llvm-objcopy --remove-symbol-prefix= %t2 %t3
+# RUN: cmp %t2 %t3
+
+## When both options are present, llvm-objcopy should remove
+## prefixes first, before adding prefixes.
+# RUN: llvm-objcopy --remove-symbol-prefix=AAA --prefix-symbols=AAA %t %t4
+# RUN: llvm-objcopy --prefix-symbols=AAA %t %t5
+# RUN: cmp %t4 %t5
----------------
jh7370 wrote:
I've already said this once: I don't think this is the best way of testing this, in part because I don't think it's particularly clear. I think instead you should use different strings for the prefix removal and addition and use llvm-readelf to show that the expected symbol names are in the output.
https://github.com/llvm/llvm-project/pull/79415
More information about the llvm-commits
mailing list