1 ## Ensures that implicitly added sections can be ordered within Sections.
3 # RUN: yaml2obj --docnum=1 %s -o %t1
4 # RUN: llvm-readobj --sections %t1 | FileCheck %s --check-prefix=SECTION
5 # RUN: llvm-nm --dynamic %t1 | FileCheck %s --check-prefix=SYMBOL
15 Flags: [ SHF_ALLOC, SHF_WRITE ]
30 # SECTION: Name: .dynsym
31 # SECTION-NEXT: Type: SHT_DYNSYM
33 # SECTION-NEXT: SHF_ALLOC
34 # SECTION: Name: .dynstr
35 # SECTION-NEXT: Type: SHT_STRTAB
37 # SECTION-NEXT: SHF_ALLOC
39 # SYMBOL-DAG: d dynlocal
40 # SYMBOL-DAG: D dynglobal
41 # SYMBOL-DAG: V dynweak
43 ## Check we can use numeric values to refer to sections.
45 # RUN: yaml2obj --docnum=2 -DSEC=0xff %s -o %t2
46 # RUN: llvm-readobj --dyn-symbols %t2 2>&1 | FileCheck -DFILE=%t2 %s --check-prefix=NUM
50 # NUM-SAME: .data (0x1)
54 # NUM-SAME: .dynsym (0x2)
57 # NUM: warning: '[[FILE]]': invalid section index: 255
59 # NUM-SAME: <?> (0xFF)
63 # NUM-SAME: Undefined (0x0)
79 Section: [[SEC=<none>]]
80 ## The case when no "Section" key is set.
83 ## Check that by default no section is set.
85 # RUN: yaml2obj --docnum=2 %s -o %t2.none
86 # RUN: llvm-readobj --dyn-symbols %t2.none 2>&1 | \
87 # RUN: FileCheck -DFILE=%t2.none %s --check-prefix=NONE
91 # NONE-SAME: Undefined (0x0)
94 # NONE-SAME: Undefined (0x0)
96 ## Check we report errors when unknown sections are referenced by dynamic symbols.
98 # RUN: not yaml2obj --docnum=3 %s 2>&1 | FileCheck -DFILE=%t3 %s --check-prefix=ERR
100 # ERR: error: unknown section referenced: '.sec1' by YAML symbol 'foo'
101 # ERR: error: unknown section referenced: '.sec2' by YAML symbol 'bar'
102 # ERR: error: unknown section referenced: '' by YAML symbol 'zed'