[llvm] [llvm-objcopy][test] Use llvm-readelf instead for clearer visualization (PR #79874)
Yi Kong via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 29 09:55:23 PST 2024
https://github.com/kongy updated https://github.com/llvm/llvm-project/pull/79874
>From ec5551ace7b7c10a5e78455bb47783fcb730808a Mon Sep 17 00:00:00 2001
From: Yi Kong <yikong at google.com>
Date: Tue, 30 Jan 2024 02:51:01 +0900
Subject: [PATCH] [llvm-objcopy][test] Use llvm-readelf instead for clearer
visualization
NFCI.
---
.../llvm-objcopy/ELF/prefix-symbols.test | 60 ++++---------------
1 file changed, 10 insertions(+), 50 deletions(-)
diff --git a/llvm/test/tools/llvm-objcopy/ELF/prefix-symbols.test b/llvm/test/tools/llvm-objcopy/ELF/prefix-symbols.test
index 8c6503d4c8e09d7..ac8f4bc1a684f73 100644
--- a/llvm/test/tools/llvm-objcopy/ELF/prefix-symbols.test
+++ b/llvm/test/tools/llvm-objcopy/ELF/prefix-symbols.test
@@ -1,8 +1,8 @@
# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --prefix-symbols prefix %t %t2
-# RUN: llvm-readobj --symbols %t2 | FileCheck %s --check-prefixes=COMMON,BASIC
+# RUN: llvm-readelf --symbols %t2 | FileCheck %s --check-prefixes=COMMON,BASIC
# RUN: llvm-objcopy --redefine-sym bar=baz --prefix-symbols prefix %t %t3
-# RUN: llvm-readobj --symbols %t3 | FileCheck %s --check-prefixes=COMMON,REDEF
+# RUN: llvm-readelf --symbols %t3 | FileCheck %s --check-prefixes=COMMON,REDEF
## Show that an empty string is permitted as the argument to
## --prefix-symbols.
@@ -40,51 +40,11 @@ Symbols:
- Name: undef
Binding: STB_GLOBAL
-# COMMON: Symbols [
-# COMMON-NEXT: Symbol {
-# COMMON-NEXT: Name:
-# COMMON-NEXT: Value: 0x0
-# COMMON-NEXT: Size: 0
-# COMMON-NEXT: Binding: Local
-# COMMON-NEXT: Type: None
-# COMMON-NEXT: Other: 0
-# COMMON-NEXT: Section: Undefined
-# COMMON-NEXT: }
-# COMMON-NEXT: Symbol {
-# COMMON-NEXT: Name: foo
-# COMMON-NEXT: Value: 0x0
-# COMMON-NEXT: Size: 0
-# COMMON-NEXT: Binding: Local
-# COMMON-NEXT: Type: Section
-# COMMON-NEXT: Other: 0
-# COMMON-NEXT: Section: .text
-# COMMON-NEXT: }
-# COMMON-NEXT: Symbol {
-# BASIC-NEXT: Name: prefixbar
-# REDEF-NEXT: Name: prefixbaz
-# COMMON-NEXT: Value: 0x0
-# COMMON-NEXT: Size: 0
-# COMMON-NEXT: Binding: Local
-# COMMON-NEXT: Type: File
-# COMMON-NEXT: Other: 0
-# COMMON-NEXT: Section: .text
-# COMMON-NEXT: }
-# COMMON-NEXT: Symbol {
-# COMMON-NEXT: Name: prefixfoobar
-# COMMON-NEXT: Value: 0x0
-# COMMON-NEXT: Size: 0
-# COMMON-NEXT: Binding: Global
-# COMMON-NEXT: Type: Function
-# COMMON-NEXT: Other: 0
-# COMMON-NEXT: Section: .text
-# COMMON-NEXT: }
-# COMMON-NEXT: Symbol {
-# COMMON-NEXT: Name: prefixundef
-# COMMON-NEXT: Value: 0x0
-# COMMON-NEXT: Size: 0
-# COMMON-NEXT: Binding: Global
-# COMMON-NEXT: Type: None
-# COMMON-NEXT: Other: 0
-# COMMON-NEXT: Section: Undefined
-# COMMON-NEXT: }
-# COMMON-NEXT:]
+#COMMON: Symbol table '.symtab' contains 5 entries:
+#COMMON-NEXT: Num: Value Size Type Bind Vis Ndx Name
+#COMMON-NEXT: 0: {{.*}} 0 NOTYPE LOCAL {{.*}}
+#COMMON-NEXT: 1: {{.*}} 0 SECTION LOCAL {{.*}} foo
+#BASIC-NEXT: 2: {{.*}} 0 FILE LOCAL {{.*}} prefixbar
+#REDEF-NEXT: 2: {{.*}} 0 FILE LOCAL {{.*}} prefixbaz
+#COMMON-NEXT: 3: {{.*}} 0 FUNC GLOBAL {{.*}} prefixfoobar
+#COMMON-NEXT: 4: {{.*}} 0 NOTYPE GLOBAL {{.*}} prefixundef
\ No newline at end of file
More information about the llvm-commits
mailing list