|
5 | 5 |
|
6 | 6 | # RUN: echo '.globl _start; _start: call group' | llvm-mc -filetype=obj -triple=x86_64 - -o %t.o
|
7 | 7 | # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t1.o
|
8 |
| -# RUN: ld.lld --gc-sections %t.o %t1.o %t1.o -o %t |
| 8 | +# RUN: ld.lld --emit-relocs --gc-sections %t.o %t1.o %t1.o -o %t |
9 | 9 | # RUN: llvm-objdump -s %t | FileCheck %s
|
| 10 | +# RUN: llvm-readobj -r %t | FileCheck %s --check-prefix=REL |
10 | 11 |
|
11 | 12 | # CHECK: Contents of section .debug_loc:
|
12 | 13 | # CHECK-NEXT: 0000 01000000 00000000 01000000 00000000
|
13 |
| -# CHECK-NEXT: Contents of section .debug_ranges: |
| 14 | +# CHECK: Contents of section .debug_ranges: |
14 | 15 | # CHECK-NEXT: 0000 01000000 00000000 01000000 00000000
|
15 |
| -# CHECK-NEXT: Contents of section .debug_addr: |
| 16 | +# CHECK: Contents of section .debug_addr: |
16 | 17 | # CHECK-NEXT: 0000 {{.*}}000 00000000 {{.*}}000 00000000
|
17 | 18 | # CHECK-NEXT: 0010 00000000 00000000 {{.*}}000 00000000
|
18 |
| -# CHECK-NEXT: Contents of section .debug_foo: |
| 19 | +# CHECK: Contents of section .debug_foo: |
19 | 20 | # CHECK-NEXT: 0000 00000000 00000000 08000000 00000000
|
20 | 21 | # CHECK-NEXT: 0010 00000000 00000000 08000000 00000000
|
21 | 22 |
|
| 23 | +# REL: Relocations [ |
| 24 | +# REL-NEXT: .rela.text { |
| 25 | +# REL-NEXT: 0x201121 R_X86_64_PLT32 group 0xFFFFFFFFFFFFFFFC |
| 26 | +# REL-NEXT: } |
| 27 | +# REL-NEXT: .rela.debug_loc { |
| 28 | +# REL-NEXT: 0x0 R_X86_64_NONE - 0x8 |
| 29 | +# REL-NEXT: 0x8 R_X86_64_NONE - 0x8 |
| 30 | +# REL-NEXT: } |
| 31 | +# REL-NEXT: .rela.debug_ranges { |
| 32 | +# REL-NEXT: 0x0 R_X86_64_NONE - 0x10 |
| 33 | +# REL-NEXT: 0x8 R_X86_64_NONE - 0x10 |
| 34 | +# REL-NEXT: } |
| 35 | +# REL-NEXT: .rela.debug_addr { |
| 36 | +# REL-NEXT: 0x0 R_X86_64_64 .text 0x1D |
| 37 | +# REL-NEXT: 0x8 R_X86_64_64 group 0x20 |
| 38 | +# REL-NEXT: 0x10 R_X86_64_NONE - 0x18 |
| 39 | +# REL-NEXT: 0x18 R_X86_64_64 group 0x20 |
| 40 | +# REL-NEXT: } |
| 41 | +# REL-NEXT: .rela.debug_foo { |
| 42 | +# REL-NEXT: 0x0 R_X86_64_NONE - 0x8 |
| 43 | +# REL-NEXT: 0x8 R_X86_64_NONE - 0x8 |
| 44 | +# REL-NEXT: 0x10 R_X86_64_NONE - 0x8 |
| 45 | +# REL-NEXT: 0x18 R_X86_64_NONE - 0x8 |
| 46 | +# REL-NEXT: } |
| 47 | +# REL-NEXT: ] |
| 48 | + |
22 | 49 | ## -z dead-reloc-in-nonalloc= can override the tombstone value.
|
23 | 50 | # RUN: ld.lld --gc-sections -z dead-reloc-in-nonalloc=.debug_loc=42 %t.o %t1.o %t1.o -o %t42
|
24 | 51 | # RUN: llvm-objdump -s %t42 | FileCheck %s --check-prefix=OVERRIDE
|
|
0 commit comments