Skip to content

Commit 54bc2d8

Browse files
committed
[ELF][test] Add a test about GCable SHF_LINK_ORDER SHT_INIT_ARRAY
1 parent ab5ac65 commit 54bc2d8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# CHECK: removing unused section {{.*}}.o:(.foo2)
77
# CHECK: removing unused section {{.*}}.o:(bar2)
8+
# CHECK: removing unused section {{.*}}.o:(.init_array.bar2)
89
# CHECK: removing unused section {{.*}}.o:(.zed2)
910

1011
.global _start
@@ -25,6 +26,11 @@ _start:
2526
.quad .zed2
2627
.quad .foo2
2728

29+
## An SHT_INIT_ARRAY with the SHF_LINK_ORDER flag can be GCed.
30+
.section .init_array.bar2,"awo",@init_array,.foo2
31+
.quad .zed2
32+
.quad .foo2
33+
2834
.section .zed1,"a"
2935
.quad 0
3036

0 commit comments

Comments
 (0)