File: gc-sections-lsda.s

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (62 lines) | stat: -rw-r--r-- 1,933 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# REQUIRES: x86
# RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux

## Discard an unused .gcc_except_table in a COMDAT group or having SHF_LINK_ORDER
## if the associated text section is discarded.

# RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov %t.o -o /dev/null | \
# RUN:   FileCheck %s --implicit-check-not=.gcc_except_table

# CHECK:      removing unused section {{.*}}.o:(.text._Z6comdatv)
# CHECK-NEXT: removing unused section {{.*}}.o:(.text._Z9linkorderv)
# CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z6comdatv)
# CHECK-NEXT: removing unused section {{.*}}.o:(.gcc_except_table._Z9linkorderv)

## An unused non-group non-SHF_LINK_ORDER .gcc_except_table is not discarded.

# RUN: ld.lld --gc-sections --print-gc-sections -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \
# RUN:   FileCheck /dev/null --implicit-check-not=.gcc_except_table

## If the text sections are live, the .gcc_except_table sections are retained as
## well because they are referenced by .eh_frame pieces.

# RUN: ld.lld --gc-sections --print-gc-sections -u _Z3foov -u _Z6comdatv -u _Z9linkorderv %t.o -o /dev/null | \
# RUN:   FileCheck %s --check-prefix=KEEP

# KEEP-NOT: .gcc_except_table

.section .text._Z3foov,"ax",@progbits
.globl _Z3foov
_Z3foov:
  .cfi_startproc
  ret
  .cfi_lsda 0x1b,.Lexception0
  .cfi_endproc

.section .text._Z6comdatv,"axG",@progbits,_Z6comdatv,comdat
.globl _Z6comdatv
_Z6comdatv:
  .cfi_startproc
  ret
  .cfi_lsda 0x1b,.Lexception1
  .cfi_endproc

.section .text._Z9linkorderv,"ax",@progbits
.globl _Z9linkorderv
_Z9linkorderv:
  .cfi_startproc
  ret
  .cfi_lsda 0x1b,.Lexception2
  .cfi_endproc

.section .gcc_except_table._Z3foov,"a",@progbits
.Lexception0:
  .byte 255

.section .gcc_except_table._Z6comdatv,"aG",@progbits,_Z6comdatv,comdat
.Lexception1:
  .byte 255

.section .gcc_except_table._Z9linkorderv,"ao",@progbits,_Z9linkorderv
.Lexception2:
  .byte 255