[InstCombine] Signed saturation patterns
[llvm-core.git] / test / tools / llvm-objdump / X86 / elf-dynamic-relocs.test
blobc8a74a56c487d9cadf5ce327c0ba8509763d2fdc
1 ## Show that llvm-objdump can dump dynamic relocations.
2 ## Specifically, we are checking that the tags DT_RELA, DT_REL and DT_JMPREL
3 ## properly identify relocation tables.
5 # RUN: yaml2obj %s -o %t
6 # RUN: llvm-objdump --dynamic-reloc %t | FileCheck --implicit-check-not=R_X86 %s
8 # CHECK:      file format ELF64-x86-64
9 # CHECK:      DYNAMIC RELOCATION RECORDS
10 # CHECK-NEXT: 0000000000000000 R_X86_64_RELATIVE *ABS*
11 # CHECK-NEXT: 0000000000000000 R_X86_64_JUMP_SLOT bar
12 # CHECK-NEXT: 0000000000000008 R_X86_64_NONE foo
14 --- !ELF
15 FileHeader:
16   Class:   ELFCLASS64
17   Data:    ELFDATA2LSB
18   Type:    ET_DYN
19   Machine: EM_X86_64
20 Sections:
21   - Name:         .foo
22     Type:         SHT_PROGBITS
23     Size:         16
24     Flags:        [SHF_ALLOC]
25     Address:      0x100000
26     AddressAlign: 0x100
27   - Name:         .got.plt
28     Type:         SHT_PROGBITS
29     Flags:        [SHF_WRITE, SHF_ALLOC]
30     Address:      0x100100
31     AddressAlign: 0x1000
32   - Name:         .rela.dyn
33     Type:         SHT_RELA
34     Address:      0x100200
35     AddressAlign: 0x100
36     Info:         .foo
37     Link:         .dynsym
38     Flags:        [SHF_ALLOC]
39     Relocations:
40       - Offset: 0
41         Type:   R_X86_64_RELATIVE
42         Addend: 0
43   - Name:         .rela.plt
44     Type:         SHT_RELA
45     Address:      0x100300
46     AddressAlign: 0x100
47     Info:         .got.plt
48     Link:         .dynsym
49     Flags:        [SHF_ALLOC]
50     Relocations:
51       - Offset: 0
52         Symbol: 2 # bar
53         Type:   R_X86_64_JUMP_SLOT
54   - Name:         .rel.dyn
55     Type:         SHT_REL
56     Address:      0x100400
57     AddressAlign: 0x100
58     Info:         .foo
59     Link:         .dynsym
60     Flags:        [SHF_ALLOC]
61     Relocations:
62       - Offset: 8
63         Symbol: 1 # foo
64         Type:   R_X86_64_NONE
65   - Name:         .dynamic
66     Type:         SHT_DYNAMIC
67     Address:      0x100500
68     AddressAlign: 0x100
69     Link:         .dynstr
70     Flags:        [SHF_ALLOC]
71     Entries:
72       - Tag: DT_RELA
73         Value: 0x100200
74       - Tag: DT_RELASZ
75         Value: 24
76       - Tag: DT_RELAENT
77         Value: 24
78       - Tag: DT_JMPREL
79         Value: 0x100300
80       - Tag: DT_PLTREL
81         Value: 7
82       - Tag: DT_PLTRELSZ
83         Value: 24
84       - Tag: DT_REL
85         Value: 0x100400
86       - Tag: DT_RELSZ
87         Value: 16
88       - Tag: DT_RELENT
89         Value: 16
90       - Tag: DT_NULL
91         Value: 0
92 ProgramHeaders:
93   - Type:     PT_LOAD
94     VAddr:    0x100000
95     Align:    0x100
96     Sections:
97       - Section: .foo
98       - Section: .rela.dyn
99       - Section: .rela.plt
100       - Section: .rel.dyn
101       - Section: .dynamic
102   - Type:     PT_DYNAMIC
103     VAddr:    0x100500
104     Align:    0x100
105     Sections:
106       - Section: .dynamic
107 DynamicSymbols:
108   - Name:    foo
109     Section: .foo
110     Binding: STB_GLOBAL
111   - Name:    bar
112     Type:    STT_FUNC
113     Binding: STB_GLOBAL