1 ## Show that llvm-readobj can dump SHT_LLVM_ADDRSIG sections.
3 # RUN: yaml2obj --docnum=1 %s -o %t1.o
4 # RUN: llvm-readobj --addrsig %t1.o | FileCheck -DFILE=%t1.o %s --check-prefix LLVM
5 # RUN: not llvm-readelf --addrsig %t1.o 2>&1 | FileCheck -DFILE=%t1.o %s --check-prefix GNU
8 # LLVM-NEXT: Sym: foo (1)
9 # LLVM-NEXT: Sym: bar (2)
12 # GNU: error: '[[FILE]]': --addrsig: not implemented
22 Type: SHT_LLVM_ADDRSIG
30 ## Check that llvm-readobj dumps any SHT_LLVM_ADDRSIG section when --all
31 ## is specified for LLVM style, but not for GNU style.
32 ## TODO: Refine the llvm-readelf check when GNU-style dumping is implemented.
34 # RUN: llvm-readobj --all %t1.o | FileCheck %s --check-prefix LLVM
35 # RUN: llvm-readelf --all %t1.o 2>&1 | FileCheck %s --implicit-check-not=warning --implicit-check-not=error
37 ## Check we report a warning when SHT_LLVM_ADDRSIG is broken (e.g. contains a malformed uleb128).
39 # RUN: yaml2obj --docnum=2 %s -o %t2.o
40 # RUN: llvm-readobj --addrsig %t2.o 2>&1 | FileCheck %s -DFILE=%t2.o --check-prefix=MALFORMED
42 # MALFORMED: warning: '[[FILE]]': malformed uleb128, extends past end
52 Type: SHT_LLVM_ADDRSIG
55 ## Check we report a warning when SHT_LLVM_ADDRSIG references a symbol that can't be
56 ## dumped (e.g. the index value is larger than the number of symbols in .symtab).
58 # RUN: yaml2obj --docnum=3 %s -o %t3.o
59 # RUN: llvm-readobj --addrsig %t3.o 2>&1 | FileCheck %s -DFILE=%t3.o --check-prefix=INVALID-INDEX
61 # INVALID-INDEX: Addrsig [
62 # INVALID-INDEX-NEXT: Sym: foo (1)
63 # INVALID-INDEX-EMPTY:
64 # INVALID-INDEX-NEXT: warning: '[[FILE]]': unable to get symbol from section [index 2]: invalid symbol index (255)
65 # INVALID-INDEX-NEXT: Sym: <?> (255)
66 # INVALID-INDEX-NEXT: Sym: bar (2)
67 # INVALID-INDEX-NEXT: ]
77 Type: SHT_LLVM_ADDRSIG