[llvm] Add functionality to llvm-objcopy to remove prefixes (PR #79415)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 00:10:18 PST 2024
================
@@ -0,0 +1,78 @@
+# RUN: yaml2obj %s -o %t
+# RUN: llvm-objcopy --prefix-symbols-remove __pf_ %t %t2
+# RUN: llvm-readobj --symbols %t2 | FileCheck %s
+
+!ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x1000
+ AddressAlign: 0x0000000000000010
+ Size: 64
+Symbols:
+ - Name: __pf_foo
+ Type: STT_SECTION
+ Section: .text
+ - Name: __pf_bar
+ Type: STT_FILE
+ Section: .text
+ - Name: foobar
+ Type: STT_FUNC
+ Section: .text
+ Binding: STB_GLOBAL
+ - Name: undef
+ Binding: STB_GLOBAL
+
+# CHECK: Symbols [
+# NEXT: Symbol {
----------------
jh7370 wrote:
This isn't going to do what you think it's going to do. Please re-read the FileCheck documentation and take a look at other tests (hint: NEXT is a suffix, not a pattern).
https://github.com/llvm/llvm-project/pull/79415
More information about the llvm-commits
mailing list