[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / tools / llvm-objdump / X86 / elf-disassemble-relocs-exec.test
blob631ee205a5c180c59c1c1c39e793b5ef96801030
1 ## Check that 'llvm-objdump --no-print-imm-hex -dr' correctly prints relocations in executables.
3 # RUN: yaml2obj --docnum=1 %s -o %t
4 # RUN: llvm-objdump --no-print-imm-hex -dr %t | FileCheck %s --match-full-lines --strict-whitespace
5 # RUN: llvm-objdump --no-print-imm-hex -dr --no-leading-addr %t | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
6 # RUN: llvm-objdump --no-print-imm-hex -dr --no-addresses %t | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
8 # RUN: yaml2obj -DBITS=32 %s -o %t.32
9 # RUN: llvm-objdump --no-print-imm-hex -dr --no-leading-addr %t.32 | FileCheck %s --check-prefix=NOADDR --match-full-lines --strict-whitespace
11 #      CHECK:0000000000400000 <.text>:
12 # CHECK-NEXT:  400000: 90                               nop
13 # CHECK-NEXT:  400001: bf 10 00 40 00                   movl    $4194320, %edi          # imm = 0x400010
14 # CHECK-NEXT:           0000000000400002:  R_X86_64_32  .rodata
15 # CHECK-NEXT:  400006: e8 fc fe ff ff                   callq   0x3fff07 <puts+0x3fff07>
16 # CHECK-NEXT:           0000000000400007:  R_X86_64_PLT32       puts-0x4
17 # CHECK-NEXT:  40000b: 90                               nop
19 #      NOADDR:<.text>:
20 # NOADDR-NEXT: 90                                       nop
21 # NOADDR-NEXT: bf 10 00 40 00                           movl    $4194320, %edi          # imm = 0x400010
22 # NOADDR-NEXT:          R_X86_64_32     .rodata
23 # NOADDR-NEXT: e8 fc fe ff ff                           callq   0x3fff07 <puts+0x3fff07>
24 # NOADDR-NEXT:          R_X86_64_PLT32  puts-0x4
25 # NOADDR-NEXT: 90                                       nop
27 --- !ELF
28 FileHeader:
29   Class:           ELFCLASS[[BITS=64]]
30   Data:            ELFDATA2LSB
31   Type:            ET_EXEC
32   Machine:         EM_X86_64
33 ProgramHeaders:
34   - Type:            PT_LOAD
35     Flags:           [ PF_X, PF_R ]
36     FirstSec:        .text
37     LastSec:         .rodata
38     VAddr:           0x400000
39 Sections:
40   - Name:            .text
41     Type:            SHT_PROGBITS
42     Flags:           [ SHF_ALLOC, SHF_EXECINSTR ]
43     Address:         0x400000
44     AddressAlign:    0x10
45     Content:         90BF10004000E8FCFEFFFF90
46   - Name:            .rodata
47     Type:            SHT_PROGBITS
48     Flags:           [ SHF_ALLOC ]
49     AddressAlign:    0x8
50     Content:         00
51   - Name:            .rela.text
52     Type:            SHT_RELA
53     Flags:           [ SHF_INFO_LINK ]
54     AddressAlign:    0x8
55     Info:            .text
56     Relocations:
57       - Offset:          0x400002
58         Symbol:          .rodata
59         Type:            R_X86_64_32
60         Addend:          0
61       - Offset:          0x400007
62         Symbol:          puts
63         Type:            R_X86_64_PLT32
64         Addend:          -4
65 Symbols:
66   - Name:            .rodata
67     Type:            STT_SECTION
68     Section:         .rodata
69     Value:           0x400628
70   - Name:            puts
71     Type:            STT_FUNC
72     Binding:         STB_GLOBAL
73 ...