|
1 |
| -// RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -o - | llvm-readobj --symbols -r --expand-relocs - | FileCheck %s |
| 1 | +# RUN: llvm-mc -filetype=obj -triple x86_64 %s -o %t |
| 2 | +# RUN: llvm-readelf -Srs %t | FileCheck %s |
2 | 3 |
|
3 |
| -// Test that we can forward reference a section. |
| 4 | +## Test that we can forward reference a section. |
4 | 5 |
|
5 | 6 | mov .rodata, %rsi
|
6 |
| -.section .rodata |
| 7 | +mov .debug_info, %rsi |
7 | 8 |
|
8 |
| -// CHECK:Relocations [ |
9 |
| -// CHECK: Section {{.*}} .rela.text { |
10 |
| -// CHECK: Relocation { |
11 |
| -// CHECK: Offset: 0x4 |
12 |
| -// CHECK: Type: R_X86_64_32S (11) |
13 |
| -// CHECK: Symbol: .rodata |
14 |
| -// CHECK: Addend: 0x0 |
15 |
| -// CHECK: } |
16 |
| -// CHECK: } |
17 |
| -// CHECK:] |
| 9 | +.section .rodata,"a" |
| 10 | +.section .debug_info,"G",@progbits,11,comdat; .long x1 |
| 11 | +.section .debug_info,"G",@progbits,22,comdat; .long x2 |
| 12 | +.section .debug_info,"",@progbits; .long x0 |
18 | 13 |
|
19 |
| -// There is only one .rodata symbol |
| 14 | +# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1 |
| 15 | +# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1 |
| 16 | +# CHECK: Relocation section '.rela.debug_info' at offset {{.*}} contains 1 |
20 | 17 |
|
21 |
| -// CHECK:Symbols [ |
22 |
| -// CHECK: Type: Section (0x3) |
23 |
| -// CHECK: Section: .rodata |
24 |
| -// CHECK-NOT: Section: .rodata |
| 18 | +# CHECK: Symbol table '.symtab' contains 8 entries: |
| 19 | +# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name |
| 20 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND |
| 21 | +# CHECK-NEXT: 0000000000000000 0 SECTION LOCAL DEFAULT 4 .rodata |
| 22 | +# CHECK-NEXT: 0000000000000000 0 SECTION LOCAL DEFAULT 11 .debug_info |
| 23 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT 5 11 |
| 24 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE LOCAL DEFAULT 8 22 |
| 25 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x1 |
| 26 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x2 |
| 27 | +# CHECK-NEXT: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND x0 |
0 commit comments