1 ## Show that llvm-readobj/llvm-readelf tools sometimes can dump the
2 ## dynamic table when it is not in a PT_DYNAMIC segment.
4 ## Case 1: The dynamic table found using the dynamic program header is corrupted
5 ## (<size of data> % <size of dynamic entry> != 0). So the table is taken
6 ## from the section header.
8 # RUN: yaml2obj --docnum=1 %s -o %t1.o
9 # RUN: llvm-readobj --dynamic-table %t1.o 2>&1 \
10 # RUN: | FileCheck -DFILE=%t1.o --check-prefixes=WARNING1,LLVM1 %s
11 # RUN: llvm-readelf --dynamic-table %t1.o 2>&1 \
12 # RUN: | FileCheck -DFILE=%t1.o --check-prefixes=WARNING1,GNU1 %s
14 # WARNING1: warning: '[[FILE]]': The SHT_DYNAMIC section '.dynamic' is not contained within the PT_DYNAMIC segment
15 # WARNING1: warning: '[[FILE]]': invalid section size (1) or entity size (16)
16 # WARNING1: warning: '[[FILE]]': SHT_DYNAMIC section header and PT_DYNAMIC program header disagree about the location of the dynamic table
17 # WARNING1: warning: '[[FILE]]': PT_DYNAMIC dynamic table is invalid: SHT_DYNAMIC will be used
19 # LLVM1: DynamicSection [ (2 entries)
20 # LLVM1-NEXT: Tag Type Name/Value
21 # LLVM1-NEXT: 0x0000000000000018 BIND_NOW 0x1
22 # LLVM1-NEXT: 0x0000000000000000 NULL 0x0
25 # GNU1: Dynamic section at offset 0x{{.*}} contains 2 entries:
26 # GNU1-NEXT: Tag Type Name/Value
27 # GNU1-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
28 # GNU1-NEXT: 0x0000000000000000 (NULL) 0x0
64 ## Case 2: The dynamic table found using the dynamic program header is different from the
65 ## table found using the section header table.
67 # RUN: yaml2obj --docnum=2 %s -o %t2.o
68 # RUN: llvm-readobj --dynamic-table %t2.o 2>&1 \
69 # RUN: | FileCheck -DFILE=%t2.o --check-prefixes=WARNING2,LLVM2 %s
70 # RUN: llvm-readelf --dynamic-table %t2.o 2>&1 \
71 # RUN: | FileCheck -DFILE=%t2.o --check-prefixes=WARNING2,GNU2 %s
73 # WARNING2: warning: '[[FILE]]': The SHT_DYNAMIC section '.dynamic' is not contained within the PT_DYNAMIC segment
74 # WARNING2: warning: '[[FILE]]': SHT_DYNAMIC section header and PT_DYNAMIC program header disagree about the location of the dynamic table
76 # LLVM2: DynamicSection [ (1 entries)
77 # LLVM2-NEXT: Tag Type Name/Value
78 # LLVM2-NEXT: 0x0000000000000000 NULL 0x0
81 # GNU2: Dynamic section at offset 0x{{.*}} contains 1 entries:
82 # GNU2-NEXT: Tag Type Name/Value
83 # GNU2-NEXT: 0x0000000000000000 (NULL) 0x0
107 Content: "00000000000000000000000000000000"
119 ## Case 3: Both dynamic tables found using SHT_DYNAMIC/PT_DYNAMIC are corrupted.
121 # RUN: yaml2obj --docnum=3 %s -o %t3.o
122 # RUN: llvm-readobj --dynamic-table %t3.o 2>&1 \
123 # RUN: | FileCheck -DFILE=%t3.o --check-prefix=WARNING3 --implicit-check-not="Dynamic" %s
124 # RUN: llvm-readelf --dynamic-table %t3.o 2>&1 \
125 # RUN: | FileCheck -DFILE=%t3.o --check-prefix=WARNING3 --implicit-check-not="Dynamic" %s
127 # WARNING3: warning: '[[FILE]]': invalid section size (1) or entity size (16)
128 # WARNING3: warning: '[[FILE]]': SHT_DYNAMIC section header and PT_DYNAMIC program header disagree about the location of the dynamic table
129 # WARNING3: warning: '[[FILE]]': no valid dynamic table was found