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 %t.o
8 # RUN: llvm-readobj --dynamic-table %t.o 2>&1 \
9 # RUN: | FileCheck %s --check-prefixes=WARNING,LLVM
10 # RUN: llvm-readelf --dynamic-table %t.o 2>&1 \
11 # RUN: | FileCheck %s --check-prefixes=WARNING,GNU
13 # WARNING: warning: The SHT_DYNAMIC section '.dynamic' is not at the start of PT_DYNAMIC segment
15 # LLVM: DynamicSection [ (2 entries)
16 # LLVM-NEXT: Tag Type Name/Value
17 # LLVM-NEXT: 0x0000000000000018 BIND_NOW 0x1
18 # LLVM-NEXT: 0x0000000000000000 NULL 0x0
21 # GNU: Dynamic section at offset 0x{{.*}} contains 2 entries:
22 # GNU-NEXT: Tag Type Name/Value
23 # GNU-NEXT: 0x0000000000000018 (BIND_NOW) 0x1
24 # GNU-NEXT: 0x0000000000000000 (NULL) 0x0
61 ## In the second case .text goes after .dynamic and we don't display any warnings.
63 # RUN: yaml2obj --docnum=2 %s -o %t.o
64 # RUN: llvm-readobj --dynamic-table %t.o | FileCheck %s --implicit-check-not="warning"
65 # RUN: llvm-readelf --dynamic-table %t.o | FileCheck %s --implicit-check-not="warning"