[llvm] Add functionality to llvm-objcopy to remove prefixes (PR #79415)
Yi Kong via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 31 21:24:16 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 {
----------------
kongy wrote:
Done.
https://github.com/llvm/llvm-project/pull/79415
More information about the llvm-commits
mailing list