1# REQUIRES: x86
2# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
3# RUN: ld.lld -pie %t.o -o %t.pie
4# RUN: llvm-readobj -r --dyn-syms %t.pie | FileCheck %s
5
6## Test that we create R_X86_64_RELATIVE relocations with -pie.
7# CHECK:      Relocations [
8# CHECK-NEXT:   Section ({{.*}}) .rela.dyn {
9# CHECK-NEXT:     0x3368 R_X86_64_RELATIVE - 0x3368
10# CHECK-NEXT:     0x3370 R_X86_64_RELATIVE - 0x3370
11# CHECK-NEXT:     0x3378 R_X86_64_RELATIVE - 0x3371
12# CHECK-NEXT:   }
13# CHECK-NEXT: ]
14
15.globl _start
16_start:
17nop
18
19 .data
20foo:
21 .quad foo
22
23.hidden bar
24.global bar
25bar:
26 .quad bar
27 .quad bar + 1
28