1 ## Show that llvm-readobj/llvm-readelf tools can dump the .dynamic section which
2 ## is not alone in PT_DYNAMIC segment.
4 ## In the first case .text is placed before .dynamic.
5 ## We check that we warn about this case.
7 # RUN: yaml2obj --docnum=1 %s -o %t1.o
8 # RUN: llvm-readobj --dynamic-table %t1.o 2>&1 \
9 # RUN: | FileCheck %s --DFILE=%t1.o --check-prefixes=WARNING,LLVM
10 # RUN: llvm-readelf --dynamic-table %t1.o 2>&1 \
11 # RUN: | FileCheck %s --DFILE=%t1.o --check-prefixes=WARNING,GNU
13 # WARNING: warning: '[[FILE]]': The SHT_DYNAMIC section '.dynamic' is not at the start of PT_DYNAMIC segment
14 # WARNING: warning: '[[FILE]]': invalid section size (33) or entity size (16)
15 # WARNING: warning: '[[FILE]]': SHT_DYNAMIC section header and PT_DYNAMIC program header disagree about the location of the dynamic table
16 # WARNING: warning: '[[FILE]]': PT_DYNAMIC dynamic table is invalid: SHT_DYNAMIC will be used
18 # LLVM: DynamicSection [ (2 entries)
19 # LLVM-NEXT: Tag Type Name/Value
20 # LLVM-NEXT: 0x0000000000000018 BIND_NOW 0x1
21 # LLVM-NEXT: 0x0000000000000000 NULL 0x0
24 # GNU: Dynamic section at offset 0x{{.*}} contains 2 entries:
25 # GNU-NEXT: Tag Type Name/Value
26 # GNU-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
27 # GNU-NEXT: 0x0000000000000000 (NULL) 0x0
63 ## In this case .text goes after .dynamic and we don't display any warnings,
64 ## though the content of the .text is used for dumping the dynamic table.
66 # RUN: yaml2obj --docnum=2 %s -o %t2.o
67 # RUN: llvm-readobj --dynamic-table %t2.o 2>&1 | FileCheck %s --check-prefix=LLVM2
68 # RUN: llvm-readelf --dynamic-table %t2.o 2>&1 | FileCheck %s --check-prefix=GNU2
70 # LLVM2: DynamicSection [ (3 entries)
71 # LLVM2-NEXT: Tag Type Name/Value
72 # LLVM2-NEXT: 0x0000000000000018 BIND_NOW 0x1
73 # LLVM2-NEXT: 0x0000000000000018 BIND_NOW 0x2
74 # LLVM2-NEXT: 0x0000000000000000 NULL 0x0
77 # GNU2: Dynamic section at offset 0x{{.*}} contains 3 entries:
78 # GNU2-NEXT: Tag Type Name/Value
79 # GNU2-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
80 # GNU2-NEXT: 0x0000000000000018 (BIND_NOW) 0x2
81 # GNU2-NEXT: 0x0000000000000000 (NULL) 0x0
105 Content: "00000000000000000000000000000000"
118 ## In this case .text goes after .dynamic, but (PT_DYNAMIC segment size % dynamic entry size != 0)
119 ## and we have to use the information from the section header instead.
121 # RUN: yaml2obj --docnum=3 %s -o %t3.o
122 # RUN: llvm-readobj --dynamic-table %t3.o 2>&1 | FileCheck %s --DFILE=%t3.o --check-prefixes=WARNING2,LLVM3
123 # RUN: llvm-readelf --dynamic-table %t3.o 2>&1 | FileCheck %s --DFILE=%t3.o --check-prefixes=WARNING2,GNU3
125 # WARNING2: warning: '[[FILE]]': invalid section size (257) or entity size (16)
126 # WARNING2: warning: '[[FILE]]': PT_DYNAMIC dynamic table is invalid: SHT_DYNAMIC will be used
128 # LLVM3: DynamicSection [ (2 entries)
129 # LLVM3-NEXT: Tag Type Name/Value
130 # LLVM3-NEXT: 0x0000000000000018 BIND_NOW 0x1
131 # LLVM3-NEXT: 0x0000000000000000 NULL 0x0
134 # GNU3: Dynamic section at offset 0x{{.*}} contains 2 entries:
135 # GNU3-NEXT: Tag Type Name/Value
136 # GNU3-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
137 # GNU3-NEXT: 0x0000000000000000 (NULL) 0x0