1# A variation of gotoff-large-code-model.s that accesses GOT value 2# with a slightly different code sequence. 3 4# REQUIRES: system-linux 5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ 7# RUN: %s -o %t.o 8# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q 9 10# RUN: llvm-bolt %t.exe --funcs init_impls --lite \ 11# RUN: -o %t.bolted 12# RUN: %t.bolted | FileCheck %s 13 14 .section .rodata.str1.1,"aMS",@progbits,1 15.LC2: 16 .string "Hello, world\n" 17 .text 18 .p2align 4 19 .globl init_impls 20 .type init_impls, @function 21init_impls: 22 .cfi_startproc 23 push %rbp 24 mov %rsp,%rbp 25 push %r15 26 push %rbx 27 sub $0x8,%rsp 28 lea 1f(%rip),%rbx 29 # R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_+0x2 301: movabsq $_GLOBAL_OFFSET_TABLE_, %r11 31 add %r11,%rbx 32 # R_X86_64_GOTOFF64 .LC2 33 movabs $.LC2@gotoff,%rax 34 lea (%rbx,%rax,1),%rax 35 mov %rax,%rdi 36 mov %rbx,%r15 37 # R_X86_64_PLTOFF64 puts 38 movabs $puts@pltoff,%rax 39 add %rbx,%rax 40 call *%rax 41 add $0x8,%rsp 42 pop %rbx 43 pop %r15 44 pop %rbp 45 retq 46 .cfi_endproc 47 .size init_impls, .-init_impls 48 49 .globl main 50 .type main, @function 51 .p2align 4 52main: 53 callq init_impls 54 xorq %rax, %rax 55 ret 56 57# CHECK: Hello, world 58