brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · b7f7bf0 Raw
58 lines · plain
1# A variation of gotoff-large-code-model.s that accesses GOT value2# with a slightly different code sequence.3 4# REQUIRES: system-linux5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \7# RUN:   %s -o %t.o8# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q9 10# RUN: llvm-bolt %t.exe --funcs init_impls --lite \11# RUN:   -o %t.bolted12# RUN: %t.bolted | FileCheck %s13 14	.section	.rodata.str1.1,"aMS",@progbits,115.LC2:16	.string	"Hello, world\n"17	.text18	.p2align 419	.globl	init_impls20	.type	init_impls, @function21init_impls:22	.cfi_startproc23  push   %rbp24  mov    %rsp,%rbp25  push   %r1526  push   %rbx27  sub    $0x8,%rsp28  lea    1f(%rip),%rbx29  #  R_X86_64_GOTPC64  _GLOBAL_OFFSET_TABLE_+0x2301: movabsq $_GLOBAL_OFFSET_TABLE_, %r1131  add    %r11,%rbx32  #  R_X86_64_GOTOFF64 .LC233  movabs $.LC2@gotoff,%rax34  lea    (%rbx,%rax,1),%rax35  mov    %rax,%rdi36  mov    %rbx,%r1537  #  R_X86_64_PLTOFF64 puts38  movabs $puts@pltoff,%rax39  add    %rbx,%rax40  call   *%rax41  add    $0x8,%rsp42  pop    %rbx43  pop    %r1544  pop    %rbp45  retq46  .cfi_endproc47  .size init_impls, .-init_impls48 49  .globl main50  .type main, @function51  .p2align 452main:53  callq init_impls54  xorq  %rax, %rax55  ret56 57# CHECK: Hello, world58