File: strip-dwo-groups.test

package info (click to toggle)
llvm-toolchain-13 1%3A13.0.1-6~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,418,812 kB
  • sloc: cpp: 5,290,827; ansic: 996,570; asm: 544,593; python: 188,212; objc: 72,027; lisp: 30,291; f90: 25,395; sh: 24,900; javascript: 9,780; pascal: 9,398; perl: 7,484; ml: 5,432; awk: 3,523; makefile: 2,892; xml: 953; cs: 573; fortran: 539
file content (85 lines) | stat: -rw-r--r-- 2,228 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
85
# RUN: yaml2obj %s -o %t
# RUN: llvm-objcopy --strip-dwo %t
# RUN: llvm-readobj --symbols -S --section-groups %t | FileCheck %s

## `llvm-objcopy --strip-dwo` strips out dwo sections, as a result, the index of 
## the symbol table, the indices of the symbols and the indices of the sections
## which go after the removed ones will change. Consequently, the fields 
## Link, Info and the content of .group need to be updated.

# CHECK-NOT: .debug_

# CHECK:      Groups {
# CHECK-NEXT:  Group {
# CHECK-NEXT:   Name: .group (1)
# CHECK-NEXT:   Index: 1{{$}}
# CHECK-NEXT:   Link: 6
# CHECK-NEXT:   Info: 2
# CHECK-NEXT:   Type: COMDAT (0x1)
# CHECK-NEXT:   Signature: group1
# CHECK-NEXT:   Section(s) in group [
# CHECK-NEXT:     .text.group1 (3)
# CHECK-NEXT:   ]

# CHECK-NOT: .debug_

# CHECK:      Name: .group (1)
# CHECK-NEXT: Index: 2{{$}}
# CHECK-NEXT: Link: 6
# CHECK-NEXT: Info: 1
# CHECK-NEXT: Type: COMDAT (0x1)
# CHECK-NEXT: Signature: group2
# CHECK-NEXT: Section(s) in group [
# CHECK-NEXT:   .text.group2 (4)
# CHECK-NEXT:   .rela.text.group2 (5)
# CHECK-NEXT: ]

# CHECK-NOT: .debug_

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_REL
  Machine: EM_X86_64
Sections:
  - Name: .debug_before.dwo
    Type: SHT_PROGBITS
  - Name: .group
    Type: SHT_GROUP
    Link: .symtab
    Info: group1
    Members:
      - SectionOrType: GRP_COMDAT
      - SectionOrType: .text.group1
  - Name:  .text.group1
    Type:  SHT_PROGBITS
    Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
  - Name: '.group (1)'
    Type: SHT_GROUP
    Link: .symtab
    Info: group2
    Members:
      - SectionOrType: GRP_COMDAT
      - SectionOrType: .text.group2
      - SectionOrType: .rela.text.group2
  - Name:  .text.group2
    Type:  SHT_PROGBITS
    Flags: [ SHF_ALLOC, SHF_EXECINSTR, SHF_GROUP ]
  - Name:  .rela.text.group2
    Type:  SHT_RELA
    Flags: [ SHF_GROUP ]
    Info:  .text.group2
  - Name: .debug_after.dwo
    Type: SHT_PROGBITS
Symbols:
  - Name:    debug_before
    Section: .debug_before.dwo
  - Name:    debug_after
    Section: .debug_after.dwo
  - Name:    group2
    Section: .text.group2
    Binding: STB_WEAK
  - Name:    group1
    Section: .text.group1
    Binding: STB_WEAK