[lld] 54bc2d8 - [ELF][test] Add a test about GCable SHF_LINK_ORDER SHT_INIT_ARRAY

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 22 17:05:01 PDT 2021


Author: Fangrui Song
Date: 2021-07-22T17:04:54-07:00
New Revision: 54bc2d812e2c85d696840839ef8525e8bda43eeb

URL: https://github.com/llvm/llvm-project/commit/54bc2d812e2c85d696840839ef8525e8bda43eeb
DIFF: https://github.com/llvm/llvm-project/commit/54bc2d812e2c85d696840839ef8525e8bda43eeb.diff

LOG: [ELF][test] Add a test about GCable SHF_LINK_ORDER SHT_INIT_ARRAY

Added: 
    

Modified: 
    lld/test/ELF/gc-sections-linkorder.s

Removed: 
    


################################################################################
diff  --git a/lld/test/ELF/gc-sections-linkorder.s b/lld/test/ELF/gc-sections-linkorder.s
index 54a29abde8e19..04b2a18dc92f9 100644
--- a/lld/test/ELF/gc-sections-linkorder.s
+++ b/lld/test/ELF/gc-sections-linkorder.s
@@ -5,6 +5,7 @@
 
 # CHECK: removing unused section {{.*}}.o:(.foo2)
 # CHECK: removing unused section {{.*}}.o:(bar2)
+# CHECK: removing unused section {{.*}}.o:(.init_array.bar2)
 # CHECK: removing unused section {{.*}}.o:(.zed2)
 
 .global _start
@@ -25,6 +26,11 @@ _start:
 .quad .zed2
 .quad .foo2
 
+## An SHT_INIT_ARRAY with the SHF_LINK_ORDER flag can be GCed.
+.section .init_array.bar2,"awo", at init_array,.foo2
+.quad .zed2
+.quad .foo2
+
 .section .zed1,"a"
 .quad 0
 


        


More information about the llvm-commits mailing list