150
|
1 # REQUIRES: x86
|
|
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
|
|
3 # RUN: ld.lld %t.o -o %t1 --gc-sections
|
173
|
4 # RUN: llvm-objdump --section-headers -D %t1 | FileCheck %s
|
150
|
5
|
|
6 ## Check that we are able to GC non-allocatable metadata sections without crash.
|
|
7
|
|
8 # CHECK: Name Size
|
|
9 # CHECK: .stack_sizes 00000001
|
|
10
|
|
11 # CHECK: Disassembly of section .stack_sizes:
|
|
12 # CHECK-EMPTY:
|
173
|
13 # CHECK-NEXT: <.stack_sizes>:
|
150
|
14 # CHECK-NEXT: 01
|
|
15
|
|
16 .section .text.live,"ax",@progbits
|
|
17 .globl live
|
|
18 live:
|
|
19 nop
|
|
20
|
|
21 .section .stack_sizes,"o",@progbits,.text.live,unique,0
|
|
22 .byte 1
|
|
23
|
|
24 .section .text.dead,"ax",@progbits
|
|
25 .globl dead
|
|
26 dead:
|
|
27 nop
|
|
28
|
|
29 .section .stack_sizes,"o",@progbits,.text.dead,unique,1
|
|
30 .byte 2
|
|
31
|
|
32 .section .text.main,"ax",@progbits
|
|
33 .globl _start
|
|
34 _start:
|
|
35 callq live@PLT
|