1 ## Check that llvm-readobj/llvm-readelf reports an error when dumping relocations if a dynamic
2 ## symbol name offset is broken (goes past the end of the dynamic symbol string table).
4 # RUN: yaml2obj %s -o %t
5 # RUN: llvm-readobj --dyn-relocations %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=LLVM
6 # RUN: llvm-readelf --dyn-relocations %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=GNU
8 # LLVM: Dynamic Relocations {
10 # LLVM-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: st_name (0x1234) is past the end of the string table of size 0x1
11 # LLVM-NEXT: 0x0 R_X86_64_NONE <corrupt> 0x0
14 # GNU: 'RELA' relocation section at offset {{.+}} contains 24 bytes:
15 # GNU-NEXT: Offset Info Type Symbol's Value Symbol's Name + Addend
17 # GNU-NEXT: warning: '[[FILE]]': unable to get name of the dynamic symbol with index 1: st_name (0x1234) is past the end of the string table of size 0x1
18 # GNU-NEXT: 0000000000000000 0000000100000000 R_X86_64_NONE 0000000000000000 <corrupt> + 0
32 Symbol: 1 ## Index of a dynamic symbol with a broken st_name.
38 Value: 0x0000000000000000
40 Value: 0x0000000000000018
42 Value: 0x0000000000000018
44 Value: 0x0000000000000000