1 # RUN: yaml2obj %s -o %t
2 # RUN: llvm-objcopy %t %t2
3 # RUN: llvm-readobj --dyn-syms %t2 | FileCheck %s
5 ## This checks that section references in the dynamic symbol table are not
6 ## corrupted after processing a file where the sequence of section headers does
7 ## not follow the order of their offsets. The tool avoids updating loadable
8 ## sections, so, the content of the dynamic symbol table stays intact and the
9 ## used section indices are preserved. In this test, the section 'dummy' comes
10 ## first while having the offset after all other sections. If the section
11 ## headers were sorted by their offsets by the tool, what it did before, the
12 ## index of the '.text' section would change from '2' to '1', which resulted
13 ## in an incorrect reference in the corresponding dynamic symbol 'foo'.
18 # CHECK-NEXT: Binding:
21 # CHECK-NEXT: Section: .text
38 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
41 Content: 0000000000000000
53 - Type: SectionHeaderTable
55 ## 'dummy' comes before '.text' in the section header table despite its offset