[lld] 4f33339 - [ELF][test] Clean up aarch64-variant_pcs.s

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 4 11:52:16 PST 2022


Author: Fangrui Song
Date: 2022-12-04T11:52:11-08:00
New Revision: 4f33339fb4d9420230fbc6b297d8b1e54c41d011

URL: https://github.com/llvm/llvm-project/commit/4f33339fb4d9420230fbc6b297d8b1e54c41d011
DIFF: https://github.com/llvm/llvm-project/commit/4f33339fb4d9420230fbc6b297d8b1e54c41d011.diff

LOG: [ELF][test] Clean up aarch64-variant_pcs.s

Added: 
    

Modified: 
    lld/test/ELF/aarch64-variant_pcs.s

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/aarch64-variant_pcs.s b/lld/test/ELF/aarch64-variant_pcs.s
index 1aef62d5aaa27..24e52b2248db1 100644
--- a/lld/test/ELF/aarch64-variant_pcs.s
+++ b/lld/test/ELF/aarch64-variant_pcs.s
@@ -1,130 +1,128 @@
 # REQUIRES: aarch64
-# RUN: split-file %s %t
-
-# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu %t/test1 -o %t.o
-# RUN: ld.lld %t.o --shared -o %t.so
-# RUN: llvm-readelf --dynamic-table %t.so | FileCheck --check-prefix T1-PCSDYN %s
-# RUN: llvm-readelf --symbols %t.so | FileCheck --check-prefix T1-PCSSYM %s
-
-# T1-PCSDYN-NOT:  0x0000000070000005 (AARCH64_VARIANT_PCS) 0
-# T1-PCSSYM:      Symbol table '.dynsym'
-# T1-PCSSYM:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_global_def
-
-# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu %t/test2 -o %t.o
-# RUN: ld.lld %t.o --shared -o %t.so
-# RUN: llvm-readelf --dynamic-table %t.so | FileCheck --check-prefix T2-PCSDYN %s
-# RUN: llvm-readelf --symbols %t.so | FileCheck --check-prefix T2-PCSSYM %s
-
-# T2-PCSDYN:      0x0000000070000005 (AARCH64_VARIANT_PCS) 0
-# T2-PCSSYM:      Symbol table '.dynsym'
-# T2-PCSSYM:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_global_def
-
-# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu %t/test3 -o %t.o
-# RUN: ld.lld %t.o --shared -o %t.so
-# RUN: llvm-readelf --dynamic-table %t.so | FileCheck --check-prefix T3-PCSDYN %s
-# RUN: llvm-readelf --symbols %t.so | FileCheck --check-prefix T3-PCSSYM %s
-
-# T3-PCSDYN:      0x0000000070000005 (AARCH64_VARIANT_PCS) 0
-# T3-PCSSYM:      Symbol table '.dynsym'
-# T3-PCSSYM:      0 IFUNC  GLOBAL DEFAULT [VARIANT_PCS] UND   pcs_ifunc_global_def
-# T3-PCSSYM:      0 NOTYPE GLOBAL DEFAULT               [[#]] pcs_func_global_def
-
-# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu %t/test4 -o %t.o
-# RUN: ld.lld %t.o --shared -o %t.so
-# RUN: llvm-readelf --dynamic-table %t.so | FileCheck --check-prefix T4-PCSDYN %s
-# RUN: llvm-readelf --symbols %t.so | FileCheck --check-prefix T4-PCSSYM %s
-
-# T4-PCSDYN-NOT:  0x0000000070000005 (AARCH64_VARIANT_PCS) 0
-# T4-PCSSYM:      Symbol table '.dynsym'
-# T4-PCSSYM:      0 IFUNC GLOBAL DEFAULT [VARIANT_PCS]  [[#]] pcs_ifunc_global_def
-
-# RUN: llvm-mc -filetype=obj -triple=aarch64-linux-gnu %t/test5 -o %t.o
-# RUN: ld.lld %t.o --shared -o %t.so
-# RUN: llvm-readelf --symbols %t.so | FileCheck --check-prefix T5-PCSSYM %s
-
-# T5-PCSSYM:      Symbol table '.dynsym'
-# T5-PCSSYM:      0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] UND   pcs_func_global_undef
-# T5-PCSSYM-NEXT: 0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_global_def
-# T5-PCSSYM-NEXT: 0 IFUNC   GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_ifunc_global_def
-# T5-PCSSYM:      Symbol table '.symtab' contains 10 entries:
-# T5-PCSSYM:      0 NOTYPE  LOCAL  DEFAULT [VARIANT_PCS] [[#]] pcs_func_local
-# T5-PCSSYM-NEXT: 0 IFUNC   LOCAL  DEFAULT [VARIANT_PCS] [[#]] pcs_ifunc_local
-# T5-PCSSYM:      0 NOTYPE  LOCAL  HIDDEN  [VARIANT_PCS] [[#]] pcs_func_global_hidden
-# T5-PCSSYM-NEXT: 0 IFUNC   LOCAL  HIDDEN  [VARIANT_PCS] [[#]] pcs_ifunc_global_hidden
-# T5-PCSSYM:      0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_global_def
-# T5-PCSSYM-NEXT: 0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] UND   pcs_func_global_undef
-# T5-PCSSYM-NEXT: 0 IFUNC   GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_ifunc_global_def
-
-
-#--- test1
+# RUN: rm -rf %t && split-file %s %t && cd %t
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 1.s -o 1.o
+# RUN: ld.lld 1.o --shared -o 1.so
+# RUN: llvm-readelf -d -s 1.so | FileCheck --check-prefix=CHECK1 %s
+
+# CHECK1:      Symbol table '.dynsym'
+# CHECK1:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+# CHECK1:      Symbol table '.symtab'
+# CHECK1:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 2.s -o 2.o
+# RUN: ld.lld 2.o --shared -o 2.so
+# RUN: llvm-readelf -d -s 2.so | FileCheck --check-prefix=CHECK2 %s
+
+# CHECK2:      0x0000000070000005 (AARCH64_VARIANT_PCS) 0
+# CHECK2:      Symbol table '.dynsym'
+# CHECK2:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+# CHECK2:      Symbol table '.symtab'
+# CHECK2:      0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 3.s -o 3.o
+# RUN: ld.lld 3.o --shared -o 3.so
+# RUN: llvm-readelf -d -s 3.so | FileCheck --check-prefix=CHECK3 %s
+
+# CHECK3:      0x0000000070000005 (AARCH64_VARIANT_PCS) 0
+# CHECK3:      Symbol table '.dynsym'
+# CHECK3:      0 IFUNC  GLOBAL DEFAULT [VARIANT_PCS] UND   ifunc_global_def
+# CHECK3:      0 NOTYPE GLOBAL DEFAULT               [[#]] func_global_def
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 4.s -o 4.o
+# RUN: ld.lld 4.o --shared -o 4.so
+# RUN: llvm-readelf -d -s 4.so | FileCheck --check-prefix=CHECK4 %s
+
+# CHECK4-NOT:  0x0000000070000005 (AARCH64_VARIANT_PCS) 0
+# CHECK4:      Symbol table '.dynsym'
+# CHECK4:      0 IFUNC GLOBAL DEFAULT [VARIANT_PCS]  [[#]] ifunc_global_def
+
+# RUN: llvm-mc -filetype=obj -triple=aarch64 5.s -o 5.o
+# RUN: ld.lld 5.o --shared -o 5.so
+# RUN: llvm-readelf -d -s 5.so | FileCheck --check-prefix=CHECK5 %s
+
+# CHECK5:      Symbol table '.dynsym' contains 4 entries:
+# CHECK5:      0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] UND   func_global_undef
+# CHECK5-NEXT: 0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+# CHECK5-NEXT: 0 IFUNC   GLOBAL DEFAULT [VARIANT_PCS] [[#]] ifunc_global_def
+# CHECK5:      Symbol table '.symtab' contains 10 entries:
+# CHECK5:      0 NOTYPE  LOCAL  DEFAULT [VARIANT_PCS] [[#]] func_local
+# CHECK5-NEXT: 0 IFUNC   LOCAL  DEFAULT [VARIANT_PCS] [[#]] ifunc_local
+# CHECK5:      0 NOTYPE  LOCAL  HIDDEN  [VARIANT_PCS] [[#]] func_global_hidden
+# CHECK5-NEXT: 0 IFUNC   LOCAL  HIDDEN  [VARIANT_PCS] [[#]] ifunc_global_hidden
+# CHECK5:      0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] [[#]] func_global_def
+# CHECK5-NEXT: 0 NOTYPE  GLOBAL DEFAULT [VARIANT_PCS] UND   func_global_undef
+# CHECK5-NEXT: 0 IFUNC   GLOBAL DEFAULT [VARIANT_PCS] [[#]] ifunc_global_def
+
+#--- 1.s
 ## An object with a variant_pcs symbol but without a R_AARCH64_JMP_SLOT
 ## should not generate a DT_AARCH64_VARIANT_PCS.
 .text
-.global pcs_func_global_def
-.variant_pcs pcs_func_global_def
+.global func_global_def
+.variant_pcs func_global_def
 
-pcs_func_global_def:
+func_global_def:
   ret
 
-#--- test2
+#--- 2.s
 ## An object with a variant_pcs symbol and with a R_AARCH64_JMP_SLOT
 ## should generate a DT_AARCH64_VARIANT_PCS.
 .text
-.global pcs_func_global_def
-.variant_pcs pcs_func_global_def
+.global func_global_def
+.variant_pcs func_global_def
 
-pcs_func_global_def:
-  bl pcs_func_global_def
+func_global_def:
+  bl func_global_def
 
-#--- test3
+#--- 3.s
 ## Same as before, but targeting a GNU IFUNC.
 .text
-.global pcs_ifunc_global_def
-.global pcs_func_global_def
-.variant_pcs pcs_ifunc_global_def
-.type pcs_ifunc_global_def, %gnu_indirect_function
+.global ifunc_global_def
+.global func_global_def
+.variant_pcs ifunc_global_def
+.type ifunc_global_def, %gnu_indirect_function
 
-pcs_func_global_def:
-  bl pcs_ifunc_global_def
+func_global_def:
+  bl ifunc_global_def
 
-#--- test4
+#--- 4.s
 ## An object with a variant_pcs symbol and with a R_AARCH64_IRELATIVE
 ## should not generate a DT_AARCH64_VARIANT_PCS.
 .text
-.global pcs_ifunc_global_def
-.global pcs_func_global_def
-.variant_pcs pcs_ifunc_global_def
-.type pcs_ifunc_global_def, %gnu_indirect_function
+.global ifunc_global_def
+.global func_global_def
+.variant_pcs ifunc_global_def
+.type ifunc_global_def, %gnu_indirect_function
 
-pcs_ifunc_global_def:
-  bl pcs_func_global_def
+ifunc_global_def:
+  bl func_global_def
 
-#--- test5
+#--- 5.s
 ## Check if STO_AARCH64_VARIANT_PCS is kept on symbol st_other for both undef,
 ## local, and hidden visibility.
 .text
-.global pcs_func_global_def, pcs_func_global_undef, pcs_func_global_hidden
-.global pcs_ifunc_global_def, pcs_ifunc_global_hidden
-.local pcs_func_local
-
-.hidden pcs_func_global_hidden, pcs_ifunc_global_hidden
-
-.type pcs_ifunc_global_def, %gnu_indirect_function
-.type pcs_ifunc_global_hidden, %gnu_indirect_function
-.type pcs_ifunc_local, %gnu_indirect_function
-
-.variant_pcs pcs_func_global_def
-.variant_pcs pcs_func_global_undef
-.variant_pcs pcs_func_global_hidden
-.variant_pcs pcs_func_local
-.variant_pcs pcs_ifunc_global_def
-.variant_pcs pcs_ifunc_global_hidden
-.variant_pcs pcs_ifunc_local
-
-pcs_func_global_def:
-pcs_func_global_hidden:
-pcs_func_local:
-pcs_ifunc_global_def:
-pcs_ifunc_global_hidden:
-pcs_ifunc_local:
+.global func_global_def, func_global_undef, func_global_hidden
+.global ifunc_global_def, ifunc_global_hidden
+.local func_local
+
+.hidden func_global_hidden, ifunc_global_hidden
+
+.type ifunc_global_def, %gnu_indirect_function
+.type ifunc_global_hidden, %gnu_indirect_function
+.type ifunc_local, %gnu_indirect_function
+
+.variant_pcs func_global_def
+.variant_pcs func_global_undef
+.variant_pcs func_global_hidden
+.variant_pcs func_local
+.variant_pcs ifunc_global_def
+.variant_pcs ifunc_global_hidden
+.variant_pcs ifunc_local
+
+func_global_def:
+func_global_hidden:
+func_local:
+ifunc_global_def:
+ifunc_global_hidden:
+ifunc_local:
   ret


        


More information about the llvm-commits mailing list