1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
3# RUN: ld.lld -r -o %t %t.o %t.o
4# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELA %s
5
6# RELA:      Relocations [
7# RELA-NEXT:   Section ({{.*}}) .rela.data {
8# RELA-NEXT:     0x0 R_X86_64_32 .text 0x1
9# RELA-NEXT:     0x4 R_X86_64_32 .text 0x5
10# RELA-NEXT:   }
11# RELA-NEXT: ]
12
13
14# RUN: llvm-mc -filetype=obj -triple=i686-pc-linux %s -o %t.o
15# RUN: ld.lld -r -o %t %t.o %t.o
16# RUN: llvm-readobj -r -S --section-data %t | FileCheck --check-prefix=REL %s
17
18
19# REL:      Section {
20# REL:        Index:
21# REL:        Name: .data
22# REL-NEXT:   Type: SHT_PROGBITS
23# REL-NEXT:   Flags [
24# REL-NEXT:     SHF_ALLOC
25# REL-NEXT:     SHF_WRITE
26# REL-NEXT:   ]
27# REL-NEXT:   Address:
28# REL-NEXT:   Offset:
29# REL-NEXT:   Size:
30# REL-NEXT:   Link:
31# REL-NEXT:   Info:
32# REL-NEXT:   AddressAlignment:
33# REL-NEXT:   EntrySize:
34# REL-NEXT:   SectionData (
35# REL-NEXT:     0000: 01000000 05000000                    |
36# REL-NEXT:   )
37# REL-NEXT: }
38
39
40# REL:      Relocations [
41# REL-NEXT:   Section ({{.*}}) .rel.data {
42# REL-NEXT:     0x0 R_386_32 .text
43# REL-NEXT:     0x4 R_386_32 .text
44# REL-NEXT:   }
45# REL-NEXT: ]
46
47
48.long 42
49.data
50.long .text + 1
51