File: stabs-icf.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 (84 lines) | stat: -rw-r--r-- 3,498 bytes parent folder | download | duplicates (3)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o

# RUN: %lld -lSystem --icf=all %t.o -o %t
# RUN: dsymutil -s %t | FileCheck %s -DDIR=%t -DSRC_PATH=%t.o

## This should include no N_FUN entry for _baz (which is ICF'd into _bar),
## but it does include a SECT EXT entry.
## NOTE: We do not omit the N_FUN entry for _bar even though it is of size zero.
##       Only folded symbols get omitted.
## NOTE: Unlike ld64, we also omit the N_FUN entry for _baz2.
# CHECK:      (N_SO         ) 00      0000   0000000000000000  '/tmp{{[/\\]}}test.cpp'
# CHECK-NEXT: (N_OSO        ) 03      0001   {{.*}} '[[SRC_PATH]]'
# CHECK-NEXT: (N_FUN        ) 01      0000   [[#%.16x,MAIN:]]  '_main'
# CHECK-NEXT: (N_FUN        ) 00      0000   000000000000000b{{$}}
# CHECK-NEXT: (N_FUN        ) 01      0000   [[#%.16x,BAR:]]   '_bar'
# CHECK-NEXT: (N_FUN        ) 00      0000   0000000000000000{{$}}
# CHECK-NEXT: (N_FUN        ) 01      0000   [[#BAR]]          '_bar2'
# CHECK-NEXT: (N_FUN        ) 00      0000   0000000000000001{{$}}
# CHECK-NEXT: (N_SO         ) 01      0000   0000000000000000{{$}}
# CHECK-DAG:  (     SECT EXT) 01      0000   [[#MAIN]]         '_main'
# CHECK-DAG:  (     SECT EXT) 01      0000   [[#BAR]]          '_bar'
# CHECK-DAG:  (     SECT EXT) 01      0000   [[#BAR]]          '_bar2'
# CHECK-DAG:  (     SECT EXT) 01      0000   [[#BAR]]          '_baz'
# CHECK-DAG:  (     SECT EXT) 01      0000   [[#BAR]]          '_baz2'
# CHECK-DAG:  (       {{.*}}) {{[0-9]+}}                 0010   {{[0-9a-f]+}}      '__mh_execute_header'
# CHECK-DAG:  (       {{.*}}) {{[0-9]+}}                 0100   0000000000000000   'dyld_stub_binder'
# CHECK-EMPTY:

.text
.globl _bar, _bar2, _baz, _baz2, _main

.subsections_via_symbols

_bar:
_bar2:
  ret

_baz:
_baz2:
  ret

_main:
Lfunc_begin0:
  call _bar
  call _baz
  ret
Lfunc_end0:

.section  __DWARF,__debug_str,regular,debug
  .asciz  "test.cpp"             ## string offset=0
  .asciz  "/tmp"                 ## string offset=9
.section  __DWARF,__debug_abbrev,regular,debug
Lsection_abbrev:
  .byte  1                       ## Abbreviation Code
  .byte  17                      ## DW_TAG_compile_unit
  .byte  1                       ## DW_CHILDREN_yes
  .byte  3                       ## DW_AT_name
  .byte  14                      ## DW_FORM_strp
  .byte  27                      ## DW_AT_comp_dir
  .byte  14                      ## DW_FORM_strp
  .byte  17                      ## DW_AT_low_pc
  .byte  1                       ## DW_FORM_addr
  .byte  18                      ## DW_AT_high_pc
  .byte  6                       ## DW_FORM_data4
  .byte  0                       ## EOM(1)
  .byte  0                       ## EOM(2)
  .byte  0                       ## EOM(3)
.section  __DWARF,__debug_info,regular,debug
.set Lset0, Ldebug_info_end0-Ldebug_info_start0 ## Length of Unit
  .long  Lset0
Ldebug_info_start0:
  .short  4                       ## DWARF version number
.set Lset1, Lsection_abbrev-Lsection_abbrev ## Offset Into Abbrev. Section
  .long  Lset1
  .byte  8                       ## Address Size (in bytes)
  .byte  1                       ## Abbrev [1] 0xb:0x48 DW_TAG_compile_unit
  .long  0                       ## DW_AT_name
  .long  9                       ## DW_AT_comp_dir
  .quad  Lfunc_begin0            ## DW_AT_low_pc
.set Lset3, Lfunc_end0-Lfunc_begin0     ## DW_AT_high_pc
  .long  Lset3
  .byte  0                       ## End Of Children Mark
Ldebug_info_end0: