56 lines · plain
1# REQUIRES: system-linux2 3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \4# RUN: %s -o %t.o5# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q6 7# RUN: llvm-bolt %t.exe --funcs init_impls --lite \8# RUN: -o %t.bolted9# RUN: %t.bolted | FileCheck %s10 11 .section .rodata.str1.1,"aMS",@progbits,112.LC2:13 .string "Hello, world\n"14 .text15 .p2align 416 .globl init_impls17 .type init_impls, @function18init_impls:19 .cfi_startproc20 push %rbp21 mov %rsp,%rbp22 push %r1523 push %rbx24 sub $0x8,%rsp251:26 lea 1b(%rip),%rbx27 # R_X86_64_GOTPC64 _GLOBAL_OFFSET_TABLE_+0x928 movabsq $_GLOBAL_OFFSET_TABLE_-1b, %r1129 add %r11,%rbx30 # R_X86_64_GOTOFF64 .LC231 movabs $.LC2@gotoff,%rax32 lea (%rbx,%rax,1),%rax33 mov %rax,%rdi34 mov %rbx,%r1535 # R_X86_64_PLTOFF64 puts36 movabs $puts@pltoff,%rax37 add %rbx,%rax38 call *%rax39 add $0x8,%rsp40 pop %rbx41 pop %r1542 pop %rbp43 retq44 .cfi_endproc45 .size init_impls, .-init_impls46 47 .globl main48 .type main, @function49 .p2align 450main:51 callq init_impls52 xorq %rax, %rax53 ret54 55# CHECK: Hello, world56