From 54bc2d812e2c85d696840839ef8525e8bda43eeb Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Thu, 22 Jul 2021 17:04:54 -0700 Subject: [PATCH] [ELF][test] Add a test about GCable SHF_LINK_ORDER SHT_INIT_ARRAY --- lld/test/ELF/gc-sections-linkorder.s | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lld/test/ELF/gc-sections-linkorder.s b/lld/test/ELF/gc-sections-linkorder.s index 54a29ab..04b2a18 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",@init_array,.foo2 +.quad .zed2 +.quad .foo2 + .section .zed1,"a" .quad 0 -- 2.7.4