1 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
3 ## Check we do not skip zeroes blocks if have relocations pointed to these places.
4 # RUN: llvm-objdump -D --reloc -j .rodata %t | FileCheck %s
5 # RUN: llvm-objdump -D --reloc -j .rodata --disassemble-symbols=rodata3 %t | FileCheck %s --check-prefix=CHECK2
7 # CHECK: 0000000000000000 <rodata1>:
8 # CHECK-NEXT: 0: 00 00 addb %al, (%rax)
9 # CHECK-NEXT: 0000000000000000: R_X86_64_64 x0
10 # CHECK-NEXT: 2: 00 00 addb %al, (%rax)
11 # CHECK-NEXT: 4: 00 00 addb %al, (%rax)
12 # CHECK-NEXT: 6: 00 00 addb %al, (%rax)
13 # CHECK-NEXT: 8: 00 00 addb %al, (%rax)
14 # CHECK-NEXT: 0000000000000008: R_X86_64_64 x1
16 # CHECK-NEXT: 16: 00 00 addb %al, (%rax)
17 # CHECK-NEXT: 18: 00 00 addb %al, (%rax)
18 # CHECK-NEXT: 0000000000000018: R_X86_64_64 x2
19 # CHECK-NEXT: 1a: 00 00 addb %al, (%rax)
20 # CHECK-NEXT: 1c: 00 00 addb %al, (%rax)
21 # CHECK-NEXT: 1e: 00 00 addb %al, (%rax)
23 # CHECK-NEXT: 000000000000001f <rodata2>:
26 # CHECK-NEXT: 0000000000000037 <rodata3>:
28 # CHECK-NEXT: 3f: 00 00 addb %al, (%rax)
29 # CHECK-NEXT: 000000000000003f: R_X86_64_64 x3
30 # CHECK-NEXT: 41: 00 00 addb %al, (%rax)
31 # CHECK-NEXT: 43: 00 00 addb %al, (%rax)
32 # CHECK-NEXT: 45: 00 00 addb %al, (%rax)
34 # CHECK2: Disassembly of section .rodata:
36 # CHECK2-NEXT: 0000000000000037 <rodata3>:
38 # CHECK2-NEXT: 3f: 00 00 addb %al, (%rax)
39 # CHECK2-NEXT: 000000000000003f: R_X86_64_64 x3
40 # CHECK2-NEXT: 41: 00 00 addb %al, (%rax)
41 # CHECK2-NEXT: 43: 00 00 addb %al, (%rax)
42 # CHECK2-NEXT: 45: 00 00 addb %al, (%rax)
45 ## Check that without -reloc all zeroes would be omitted.
46 # RUN: llvm-objdump -D %t | FileCheck %s --check-prefix=SKIP
48 # SKIP: Disassembly of section .rodata:
50 # SKIP-NEXT: 0000000000000000 <rodata1>:
52 # SKIP-NEXT: 1c: 00 00 addb %al, (%rax)
53 # SKIP-NEXT: 1e: 00 00 addb %al, (%rax)
55 # SKIP-NEXT: 000000000000001f <rodata2>:
58 # SKIP-NEXT: 0000000000000037 <rodata3>:
61 # SKIP-NEXT: Disassembly of section .rela.rodata:
64 .globl rodata1, rodata2
66 .reloc ., BFD_RELOC_64, x0
68 .reloc ., BFD_RELOC_64, x1
70 .reloc ., BFD_RELOC_64, x2
78 .reloc ., BFD_RELOC_64, x3