1 # RUN: yaml2obj %s -o %t
3 # RUN: llvm-objcopy %t %t2
4 # RUN: llvm-readobj --sections %t2 | FileCheck %s
7 # RUN: llvm-strip --no-strip-all %t3
8 # RUN: llvm-readobj --sections %t3 | FileCheck %s
10 # RUN: llvm-objcopy --add-symbol=another=.text:0,function %t %t4
11 # RUN: llvm-readobj --sections %t4 | FileCheck %s
13 ## A section with sh_link referencing SHT_SYMTAB indicates that its content may
14 ## use the old symbol indices. If the symbol indices change, reset sh_link to 0
15 ## to inform tools like linkers that the sh_link has been invalidated.
17 ## Strip first symbol.
18 # RUN: llvm-objcopy --strip-symbol bar %t %t5
19 # RUN: llvm-readobj --sections %t5 | FileCheck %s --check-prefix=LINK-0
21 # RUN: llvm-objcopy --strip-symbol baz %t %t6
22 # RUN: llvm-readobj --sections %t6 | FileCheck %s --check-prefix=LINK-0
24 # RUN: llvm-objcopy --localize-symbol baz %t %t7
25 # RUN: llvm-readobj --sections %t7 | FileCheck %s --check-prefix=LINK-0
26 ## Remove .text section.
27 # RUN: llvm-objcopy --remove-section=.text %t %t8
28 # RUN: llvm-readobj --sections %t8 | FileCheck %s --check-prefix=LINK-0
39 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
41 AddressAlign: 0x0000000000000010
63 # CHECK-NEXT: Flags [ (0x0)
65 # CHECK-NEXT: Address:
68 # CHECK-NEXT: Link: [[#SYMTABIDX:]]
70 # CHECK: Index: [[#SYMTABIDX]]
71 # CHECK-NEXT: Name: .symtab
72 # CHECK-NEXT: Type: SHT_SYMTAB
76 # LINK-0-NEXT: Flags [ (0x0)
78 # LINK-0-NEXT: Address:
79 # LINK-0-NEXT: Offset:
81 # LINK-0-NEXT: Link: 0